summaryrefslogtreecommitdiff
path: root/platform/osx
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-05-02 15:34:46 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-05-06 11:06:52 -0700
commit2ec95bc490c5793b7b8a3aa9999f48d196ca8085 (patch)
tree413367e75df10a728a455d93cbfca80dda3b9662 /platform/osx
parent5ccb43477fc1d2028aef283d0db64848ebc9a347 (diff)
downloadqtlocation-mapboxgl-2ec95bc490c5793b7b8a3aa9999f48d196ca8085.tar.gz
[ios, osx] Renamed version constant, linked to more info
Renamed MGLStyleCurrentVersion to MGLStyleDefaultVersion to emphasize the constant’s role as an indicator of the default version used by SDK classes, which may be behind depending on release schedules. In the documentation for each style URL method, include the actual version number instead of the constant. In unit tests, verify that this documentation is in sync with the constant. Link each style URL method’s documentation to a forthcoming webpage on mapbox.com that describes the style in rich detail.
Diffstat (limited to 'platform/osx')
-rw-r--r--platform/osx/app/MapDocument.m36
-rw-r--r--platform/osx/src/MGLMapView.mm4
2 files changed, 20 insertions, 20 deletions
diff --git a/platform/osx/app/MapDocument.m b/platform/osx/app/MapDocument.m
index 64f814dd28..bc692ba213 100644
--- a/platform/osx/app/MapDocument.m
+++ b/platform/osx/app/MapDocument.m
@@ -120,22 +120,22 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = {
NSURL *styleURL;
switch (tag) {
case 1:
- styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion];
+ styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion];
break;
case 2:
- styleURL = [MGLStyle outdoorsStyleURLWithVersion:MGLStyleCurrentVersion];
+ styleURL = [MGLStyle outdoorsStyleURLWithVersion:MGLStyleDefaultVersion];
break;
case 3:
- styleURL = [MGLStyle lightStyleURLWithVersion:MGLStyleCurrentVersion];
+ styleURL = [MGLStyle lightStyleURLWithVersion:MGLStyleDefaultVersion];
break;
case 4:
- styleURL = [MGLStyle darkStyleURLWithVersion:MGLStyleCurrentVersion];
+ styleURL = [MGLStyle darkStyleURLWithVersion:MGLStyleDefaultVersion];
break;
case 5:
- styleURL = [MGLStyle satelliteStyleURLWithVersion:MGLStyleCurrentVersion];
+ styleURL = [MGLStyle satelliteStyleURLWithVersion:MGLStyleDefaultVersion];
break;
case 6:
- styleURL = [MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleCurrentVersion];
+ styleURL = [MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleDefaultVersion];
break;
default:
NSAssert(NO, @"Cannot set style from control with tag %li", (long)tag);
@@ -447,22 +447,22 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = {
NSCellStateValue state;
switch (menuItem.tag) {
case 1:
- state = [styleURL isEqual:[MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion]];
+ state = [styleURL isEqual:[MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion]];
break;
case 2:
- state = [styleURL isEqual:[MGLStyle outdoorsStyleURLWithVersion:MGLStyleCurrentVersion]];
+ state = [styleURL isEqual:[MGLStyle outdoorsStyleURLWithVersion:MGLStyleDefaultVersion]];
break;
case 3:
- state = [styleURL isEqual:[MGLStyle lightStyleURLWithVersion:MGLStyleCurrentVersion]];
+ state = [styleURL isEqual:[MGLStyle lightStyleURLWithVersion:MGLStyleDefaultVersion]];
break;
case 4:
- state = [styleURL isEqual:[MGLStyle darkStyleURLWithVersion:MGLStyleCurrentVersion]];
+ state = [styleURL isEqual:[MGLStyle darkStyleURLWithVersion:MGLStyleDefaultVersion]];
break;
case 5:
- state = [styleURL isEqual:[MGLStyle satelliteStyleURLWithVersion:MGLStyleCurrentVersion]];
+ state = [styleURL isEqual:[MGLStyle satelliteStyleURLWithVersion:MGLStyleDefaultVersion]];
break;
case 6:
- state = [styleURL isEqual:[MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleCurrentVersion]];
+ state = [styleURL isEqual:[MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleDefaultVersion]];
break;
default:
return NO;
@@ -557,12 +557,12 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = {
}
NSArray *styleURLs = @[
- [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion],
- [MGLStyle outdoorsStyleURLWithVersion:MGLStyleCurrentVersion],
- [MGLStyle lightStyleURLWithVersion:MGLStyleCurrentVersion],
- [MGLStyle darkStyleURLWithVersion:MGLStyleCurrentVersion],
- [MGLStyle satelliteStyleURLWithVersion:MGLStyleCurrentVersion],
- [MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleCurrentVersion],
+ [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion],
+ [MGLStyle outdoorsStyleURLWithVersion:MGLStyleDefaultVersion],
+ [MGLStyle lightStyleURLWithVersion:MGLStyleDefaultVersion],
+ [MGLStyle darkStyleURLWithVersion:MGLStyleDefaultVersion],
+ [MGLStyle satelliteStyleURLWithVersion:MGLStyleDefaultVersion],
+ [MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleDefaultVersion],
];
return [styleURLs indexOfObject:self.mapView.styleURL];
}
diff --git a/platform/osx/src/MGLMapView.mm b/platform/osx/src/MGLMapView.mm
index 0202c0dacb..741f0a7c02 100644
--- a/platform/osx/src/MGLMapView.mm
+++ b/platform/osx/src/MGLMapView.mm
@@ -532,7 +532,7 @@ public:
- (nonnull NSURL *)styleURL {
NSString *styleURLString = @(_mbglMap->getStyleURL().c_str()).mgl_stringOrNilIfEmpty;
- return styleURLString ? [NSURL URLWithString:styleURLString] : [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion];
+ return styleURLString ? [NSURL URLWithString:styleURLString] : [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion];
}
- (void)setStyleURL:(nullable NSURL *)styleURL {
@@ -547,7 +547,7 @@ public:
if (![MGLAccountManager accessToken]) {
return;
}
- styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion];
+ styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion];
}
if (![styleURL scheme]) {