From 11eebc498fd751e704a4738708a1ca72a1c943ba Mon Sep 17 00:00:00 2001 From: Brad Leege Date: Mon, 23 Mar 2015 11:48:53 -0500 Subject: [PATCH] #1033 - Initial location of map.load event --- platform/ios/MGLMapView.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index f20c43cae..fe835f7fe 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -387,6 +387,14 @@ mbgl::DefaultFileSource *mbglFileSource = nullptr; _regionChangeDelegateQueue = [NSOperationQueue new]; _regionChangeDelegateQueue.maxConcurrentOperationCount = 1; + + // Fire map.load + NSMutableDictionary *evt = [[NSMutableDictionary alloc] init]; + [evt setValue:[[NSNumber alloc] initWithDouble:mbglMap->getLatLng().latitude] forKey:@"lat"]; + [evt setValue:[[NSNumber alloc] initWithDouble:mbglMap->getLatLng().longitude] forKey:@"lng"]; + [evt setValue:[[NSNumber alloc] initWithDouble:mbglMap->getZoom()] forKey:@"zoom"]; + [[MGLMapboxEvents sharedManager] pushEvent:@"map.load" withAttributes:evt]; + return YES; }