Skip to content
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

Fixed polygon and polyline not re-render when changing tile URL #2057

Conversation

LeMinh1995
Copy link
Contributor

No description provided.

@LeMinh1995
Copy link
Contributor Author

Hi. Currently, I'm working with UrlTile component. But I found an issue when changing tile URL dynamically. The polygons and polylines are disappeared.

@@ -39,6 +39,13 @@ - (void) update
if (_map == nil) return;
[_map removeOverlay:self];
[_map addOverlay:self level:MKOverlayLevelAboveLabels];
for (id<MKOverlay> overlay in _map.overlays) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this have performance issues. Isn't there any way to decide the "zIndex" of an overlay so we don't have to remove and add the other overlays?

Copy link
Contributor Author

@LeMinh1995 LeMinh1995 Mar 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried to use insertOverlay with atIndex equals to 0. But it still not working. So this is the solution I came up so far.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a look and it seems that it's done the same way for the polylines and the rest of the views. Thank you.

@rborn
Copy link
Collaborator

rborn commented Mar 6, 2018

LGTM @alvelig 🐽

@rborn
Copy link
Collaborator

rborn commented Mar 12, 2018

@alvelig 🐽🐽 - aka double 🐽 😹

@alvelig
Copy link
Contributor

alvelig commented Mar 13, 2018

@rborn thank you for pushing us forward. LGTM. At least I don't have another alternative to come up with.

@rborn rborn merged commit 60c562b into react-native-maps:master Mar 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants