#1033 - Map Zoom out event

This commit is contained in:
Brad Leege
2015-03-23 13:25:39 -05:00
parent 14c4ce75e1
commit 8b2d18814e

View File

@@ -902,6 +902,16 @@ mbgl::DefaultFileSource *mbglFileSource = nullptr;
[weakSelf unrotateIfNeededAnimated:YES];
[weakSelf notifyMapChange:@(mbgl::MapChangeRegionDidChangeAnimated)];
// Send Map Zoom Event
CGPoint ptInView = CGPointMake([twoFingerTap locationInView:twoFingerTap.view].x, [twoFingerTap locationInView:twoFingerTap.view].y);
CLLocationCoordinate2D coord = [self convertPoint:ptInView toCoordinateFromView:twoFingerTap.view];
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
[dict setValue:[[NSNumber alloc] initWithDouble:coord.latitude] forKey:@"lat"];
[dict setValue:[[NSNumber alloc] initWithDouble:coord.longitude] forKey:@"lng"];
[dict setValue:[[NSNumber alloc] initWithDouble:[weakSelf zoomLevel]] forKey:@"zoom"];
[[MGLMapboxEvents sharedManager] pushEvent:@"map.click" withAttributes:dict];
}];
}
}