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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/ios/AirMaps/AIRMapUrlTile.m
Original file line number Diff line number Diff line change
Expand Up @@ -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.

if ([overlay isKindOfClass:[AIRMapUrlTile class]]) {
continue;
}
[_map removeOverlay:overlay];
[_map addOverlay:overlay];
}
}

#pragma mark MKOverlay implementation
Expand Down