#1033 - Adding MGLMapboxEvents to MGLMapView

This commit is contained in:
Brad Leege
2015-03-20 16:30:07 -05:00
parent ec304d37ac
commit c4097fff2d

View File

@@ -21,9 +21,9 @@
#import "NSArray+MGLAdditions.h"
#import "NSDictionary+MGLAdditions.h"
#import "MGLMapboxEvents.h"
#import "MGLMetricsLocationManager.h"
// Returns the path to the default cache database on this system.
const std::string &defaultCacheDatabase() {
static const std::string path = []() -> std::string {
@@ -170,6 +170,7 @@ mbgl::DefaultFileSource *mbglFileSource = nullptr;
if (accessToken)
{
mbglMap->setAccessToken((std::string)[accessToken cStringUsingEncoding:[NSString defaultCStringEncoding]]);
[[MGLMapboxEvents sharedManager] setAccessToken:accessToken];
}
}
@@ -210,6 +211,17 @@ mbgl::DefaultFileSource *mbglFileSource = nullptr;
// setup accessibility
//
self.accessibilityLabel = @"Map";
// setup Metrics
MGLMapboxEvents *events = [MGLMapboxEvents sharedManager];
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
NSString *appVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
if (appName != nil) {
events.appName = appName;
}
if (appVersion != nil) {
events.appVersion = appVersion;
}
// create GL view
//