summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-08-15 23:34:41 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-08-17 23:16:59 -0700
commit61df0b1bfa0cd43bcc9a87f73f7ece6fbb9b4175 (patch)
treef156fd35db31827104ca4b29d01e8b173a25014c /platform
parentbca9d091805dc01a4456ab3f24e9de87f9b4aa48 (diff)
downloadqtlocation-mapboxgl-61df0b1bfa0cd43bcc9a87f73f7ece6fbb9b4175.tar.gz
[ios, macos] Use local GeoJSON for runtime styling demo
Also changed the menu item to something more descriptive. Fixes #6021.
Diffstat (limited to 'platform')
-rw-r--r--platform/ios/app/MBXViewController.m5
-rw-r--r--platform/macos/app/Base.lproj/MapDocument.xib2
-rw-r--r--platform/macos/app/MapDocument.m3
3 files changed, 6 insertions, 4 deletions
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m
index 4c98dc75fb..bd8230ea15 100644
--- a/platform/ios/app/MBXViewController.m
+++ b/platform/ios/app/MBXViewController.m
@@ -203,7 +203,7 @@ static NSString * const MBXViewControllerAnnotationViewReuseIdentifer = @"MBXVie
@"Start World Tour",
@"Add Custom Callout Point",
@"Remove Annotations",
- @"Runtime Styling",
+ @"Manipulate Style",
((_customUserLocationAnnnotationEnabled)
? @"Disable Custom User Dot"
: @"Enable Custom User Dot"),
@@ -479,7 +479,8 @@ static NSString * const MBXViewControllerAnnotationViewReuseIdentifer = @"MBXVie
- (void)styleGeoJSONSource
{
- NSURL *geoJSONURL = [NSURL URLWithString:@"https://dl.dropboxusercontent.com/u/5285447/amsterdam.geojson"];
+ NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"];
+ NSURL *geoJSONURL = [NSURL fileURLWithPath:filePath];
MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithSourceIdentifier:@"ams" URL:geoJSONURL];
[self.mapView.style addSource:source];
diff --git a/platform/macos/app/Base.lproj/MapDocument.xib b/platform/macos/app/Base.lproj/MapDocument.xib
index 93fe5cbeec..5b2b75be9c 100644
--- a/platform/macos/app/Base.lproj/MapDocument.xib
+++ b/platform/macos/app/Base.lproj/MapDocument.xib
@@ -129,7 +129,7 @@
<action selector="selectFeatures:" target="-1" id="ikt-CZ-yZT"/>
</connections>
</menuItem>
- <menuItem title="Runtime styling" id="qZJ-mM-bLj">
+ <menuItem title="Manipulate Style" id="qZJ-mM-bLj">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="runtimeStyling:" target="-1" id="gN9-lw-fG8"/>
diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m
index 24f172b41b..65b2032f5c 100644
--- a/platform/macos/app/MapDocument.m
+++ b/platform/macos/app/MapDocument.m
@@ -495,7 +495,8 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio
};
fillStyleLayer.fillColor = colorFunction;
- NSURL *geoJSONURL = [NSURL URLWithString:@"https://dl.dropboxusercontent.com/u/5285447/amsterdam.geojson"];
+ NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"];
+ NSURL *geoJSONURL = [NSURL fileURLWithPath:filePath];
MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithSourceIdentifier:@"ams" URL:geoJSONURL];
[self.mapView.style addSource:source];