New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS google maps change urlTemplate on button press #2200
Comments
Hi Osvaldas, I have encountered exact same problem, which is a critical feature for me. I managed to solve this exact issue by modifying objective-c source code. However, even though it changes url now, it seems there is still something wrong with cache clearing. First time I change url it works flawlessly. Second time I change templateUrl it seems to not clear cache and you have to zoom map view to see new tiles, otherwise you can still see old tiles (cached?). I am not competent with objective-c at all so maybe someone will notice the mistake I made and will help implement proper cache clearing
and
|
Any news in this issue ? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Is this a bug report?
Yes
Have you read the Installation Instructions?
Yes
Environment
react-native: 0.55.2
react: 16.3.1
react-native-maps: 0.21.0
iOS GoogleMaps
Steps to Reproduce
The problem: We have a floor picker and on floor select we change urlTemplate for UrlTiles component. On android everything works fine, but on iOS google maps tiles are not rerendered and old urlTemplate is used.
Expected Behavior
Tiles from new urlTemplate should be rendered.
Actual Behavior
iOS google maps after button press and urlTemplate changed to different url, still initial urlTemplate is used -> new tiles from new urlTemplate is not rendered.
Android - works fine, urlTemplate can be changed on button press.
Reproducible Demo
Snack url https://snack.expo.io/r1bIYXQnf
Code used from https://github.com/react-community/react-native-maps/blob/master/example/examples/CustomTiles.js
only change I have made is that urlTemplate is stored and retrieved from state. Initial urlTemplate is empty string and changed to http://c.tile.stamen.com/watercolor/{z}/{x}/{y}.jpg on TouchableOpacity press
The text was updated successfully, but these errors were encountered: