summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Leege <bleege@gmail.com>2015-04-03 11:36:30 -0500
committerBrad Leege <bleege@gmail.com>2015-04-03 11:36:30 -0500
commit841fba352b5aab1ebba01b0de46204621b2f1fcd (patch)
tree97a1b40ceaa2f531f7a48c091fec038171637c4d
parent6a04f3d51dade2ea17c4615334c356dac7fab367 (diff)
parent8413da0d682231214268c8fd0d2418dc30f0ecf5 (diff)
downloadqtlocation-mapboxgl-841fba352b5aab1ebba01b0de46204621b2f1fcd.tar.gz
Merge pull request #1196 from mapbox/1195-speed-course
Speed And Course Attributes
-rw-r--r--include/mbgl/ios/MGLMapboxEvents.h2
-rw-r--r--platform/ios/MGLMapboxEvents.m2
-rw-r--r--platform/ios/MGLMetricsLocationManager.m4
3 files changed, 7 insertions, 1 deletions
diff --git a/include/mbgl/ios/MGLMapboxEvents.h b/include/mbgl/ios/MGLMapboxEvents.h
index ea37edbb8e..e51371368d 100644
--- a/include/mbgl/ios/MGLMapboxEvents.h
+++ b/include/mbgl/ios/MGLMapboxEvents.h
@@ -8,6 +8,8 @@ extern NSString *const MGLEventTypeLocation;
extern NSString *const MGLEventKeyLatitude;
extern NSString *const MGLEventKeyLongitude;
extern NSString *const MGLEventKeyZoomLevel;
+extern NSString *const MGLEventKeySpeed;
+extern NSString *const MGLEventKeyCourse;
extern NSString *const MGLEventKeyPushEnabled;
extern NSString *const MGLEventKeyEmailEnabled;
extern NSString *const MGLEventKeyGestureID;
diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m
index d561b1ab5f..1db0f9e9f6 100644
--- a/platform/ios/MGLMapboxEvents.m
+++ b/platform/ios/MGLMapboxEvents.m
@@ -20,6 +20,8 @@ NSString *const MGLEventTypeLocation = @"location";
NSString *const MGLEventKeyLatitude = @"lat";
NSString *const MGLEventKeyLongitude = @"lng";
NSString *const MGLEventKeyZoomLevel = @"zoom";
+NSString *const MGLEventKeySpeed = @"speed";
+NSString *const MGLEventKeyCourse = @"course";
NSString *const MGLEventKeyPushEnabled = @"enabled.push";
NSString *const MGLEventKeyEmailEnabled = @"enabled.email";
NSString *const MGLEventKeyGestureID = @"gesture";
diff --git a/platform/ios/MGLMetricsLocationManager.m b/platform/ios/MGLMetricsLocationManager.m
index c0ff740b3a..7a6d12ec1f 100644
--- a/platform/ios/MGLMetricsLocationManager.m
+++ b/platform/ios/MGLMetricsLocationManager.m
@@ -45,7 +45,9 @@
for (CLLocation *loc in locations) {
[MGLMapboxEvents pushEvent:MGLEventTypeLocation withAttributes:@{
MGLEventKeyLatitude: @(loc.coordinate.latitude),
- MGLEventKeyLongitude: @(loc.coordinate.longitude)
+ MGLEventKeyLongitude: @(loc.coordinate.longitude),
+ MGLEventKeySpeed: @(loc.speed),
+ MGLEventKeyCourse: @(loc.course)
}];
}
}