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

Fix crash when user click on blue userLocation #1122

Merged
merged 2 commits into from
Mar 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG/mapview_curloc_crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## MapView
- Fixed a crash when tapping the user's current location on iOS.
12 changes: 9 additions & 3 deletions Source/Fuse.Maps/iOS/MapViewDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,12 @@ -(int)nextId

-(void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view
{
if(markerSelectBlock){
FusePinAnnotation* a = [view annotation];
markerSelectBlock(a.markerID, a.title);
id annotation = view.annotation;
if (![annotation isKindOfClass:[MKUserLocation class]]) {
if(markerSelectBlock){
FusePinAnnotation* a = [view annotation];
markerSelectBlock(a.markerID, a.title);
}
}
}

Expand Down Expand Up @@ -285,6 +288,9 @@ -(double)pixelSpaceYToLatitude:(double)pixelY
}
-(MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id <MKAnnotation>)annotation
{
if ([annotation isKindOfClass:[MKUserLocation class]])
return nil; //return nil to use default blue dot view

static NSString *SFAnnotationIdentifier = @"SFAnnotationIdentifier";
NSString* identifier = SFAnnotationIdentifier;

Expand Down