diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-04-26 00:54:54 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2016-05-05 01:07:29 -0700 |
commit | ebf8fa36c613e03e4f3ab0972ed4229b3b374c68 (patch) | |
tree | 0f96c5f9720b16d4dec332322cdb5561c238e092 | |
parent | 1a565a5fb72658c91428e108230e72c5fb2cf4d1 (diff) | |
download | qtlocation-mapboxgl-ebf8fa36c613e03e4f3ab0972ed4229b3b374c68.tar.gz |
[ios] Name world tour destinations
Assigned titles to the world tour annotations.
-rw-r--r-- | platform/ios/app/MBXViewController.m | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 995f99072b..a0fe6b22bf 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -10,11 +10,26 @@ #import <OpenGLES/ES2/gl.h> #import <objc/runtime.h> -static const CLLocationCoordinate2D WorldTourDestinations[] = { - { .latitude = 38.9131982, .longitude = -77.0325453144239 }, - { .latitude = 37.7757368, .longitude = -122.4135302 }, - { .latitude = 12.9810816, .longitude = 77.6368034 }, - { .latitude = -13.15589555, .longitude = -74.2178961777998 }, +static const struct { + const char *name; + CLLocationCoordinate2D coordinate; +} WorldTourDestinations[] = { + { + .name = "Washington, D.C.", + .coordinate = { .latitude = 38.9131982, .longitude = -77.0325453144239 }, + }, + { + .name = "San Francisco", + .coordinate = { .latitude = 37.7757368, .longitude = -122.4135302 }, + }, + { + .name = "Bangalore", + .coordinate = { .latitude = 12.9810816, .longitude = 77.6368034 }, + }, + { + .name = "Ayacucho", + .coordinate = { .latitude = -13.15589555, .longitude = -74.2178961777998 }, + }, }; @interface MBXDroppedPinAnnotation : MGLPointAnnotation @@ -554,7 +569,8 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = { for (NSUInteger i = 0; i < numberOfAnnotations; i++) { MBXDroppedPinAnnotation *annotation = [[MBXDroppedPinAnnotation alloc] init]; - annotation.coordinate = WorldTourDestinations[i]; + annotation.title = @(WorldTourDestinations[i].name); + annotation.coordinate = WorldTourDestinations[i].coordinate; [annotations addObject:annotation]; } [self.mapView addAnnotations:annotations]; |