summaryrefslogtreecommitdiff
path: root/platform/macos
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2017-05-08 17:45:22 -0700
committerMinh Nguyễn <mxn@1ec5.org>2017-05-12 10:02:27 -0700
commit886bf2528ff1615a50521e75fc6ea211cef3b8d7 (patch)
tree6b52b83801a5655ebceb7e26acc7c61260fb05ab /platform/macos
parentc5ee41a93a1f012acf41f29dc8bd75dc736ff4bc (diff)
downloadqtlocation-mapboxgl-886bf2528ff1615a50521e75fc6ea211cef3b8d7.tar.gz
[core, android, ios, macos] Added Traffic Day/Night to default styles
The Styles API section of the Mapbox API Documentation site now lists Traffic Day v2 and Traffic Night v2, so this change adds those styles to all the places where styles are listed. Also switched iosapp and macosapp to unversioned style factory methods since MGLStyleDefaultVersion is no longer applicable for all styles. Cherry-picked from 4d6f54553d277c0af24a0b8ff03d2dd7e9284ca2.
Diffstat (limited to 'platform/macos')
-rw-r--r--platform/macos/CHANGELOG.md1
-rw-r--r--platform/macos/app/Base.lproj/MainMenu.xib22
-rw-r--r--platform/macos/app/Base.lproj/MapDocument.xib16
-rw-r--r--platform/macos/app/MapDocument.m47
4 files changed, 57 insertions, 29 deletions
diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md
index 298cc8ecfc..632bcfa44b 100644
--- a/platform/macos/CHANGELOG.md
+++ b/platform/macos/CHANGELOG.md
@@ -6,6 +6,7 @@
* Added support for 3D extrusion of buildings and other polygonal features via the `MGLFillExtrusionStyleLayer` class and the `fill-extrusion` layer type in style JSON. ([#8431](https://github.com/mapbox/mapbox-gl-native/pull/8431))
* MGLMapView and MGLTilePyramidOfflineRegion now default to version 10 of the Mapbox Streets style. Similarly, several style URL class methods of MGLStyle return URLs to version 10 styles. Unversioned variations of these methods are no longer deprecated. `MGLStyleDefaultVersion` should no longer be used with any style other than Streets. ([#6301](https://github.com/mapbox/mapbox-gl-native/pull/6301))
+* Added class methods to MGLStyle that correspond to the new [Traffic Day and Traffic Night](https://www.mapbox.com/blog/live-traffic-maps/) styles. ([#6301](https://github.com/mapbox/mapbox-gl-native/pull/6301))
* MGLSymbolStyleLayer’s `iconImageName`, `iconScale`, `textFontSize`, `textOffset`, and `textRotation` properties can now be set to a source or composite function. ([#8544](https://github.com/mapbox/mapbox-gl-native/pull/8544), [#8590](https://github.com/mapbox/mapbox-gl-native/pull/8590), [#8592](https://github.com/mapbox/mapbox-gl-native/pull/8592), [#8593](https://github.com/mapbox/mapbox-gl-native/pull/8593))
* Fixed an issue where setting the `MGLVectorStyleLayer.predicate` property failed to take effect if the relevant source was not in use by a visible layer at the time. ([#8653](https://github.com/mapbox/mapbox-gl-native/pull/8653))
* Fixed an issue causing a composite function’s highest zoom level stop to be misinterpreted. ([#8613](https://github.com/mapbox/mapbox-gl-native/pull/8613), [#8790](https://github.com/mapbox/mapbox-gl-native/pull/8790))
diff --git a/platform/macos/app/Base.lproj/MainMenu.xib b/platform/macos/app/Base.lproj/MainMenu.xib
index 941bed2136..20a4f65b3f 100644
--- a/platform/macos/app/Base.lproj/MainMenu.xib
+++ b/platform/macos/app/Base.lproj/MainMenu.xib
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1217" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
- <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="12120"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -395,6 +395,16 @@
<action selector="showStyle:" target="-1" id="NTT-Y1-EqU"/>
</connections>
</menuItem>
+ <menuItem title="Traffic Day" tag="7" keyEquivalent="7" id="m9S-sv-Dch">
+ <connections>
+ <action selector="showStyle:" target="-1" id="lXM-BW-dDw"/>
+ </connections>
+ </menuItem>
+ <menuItem title="Traffic Night" tag="8" keyEquivalent="8" id="yVS-VL-Xsy">
+ <connections>
+ <action selector="showStyle:" target="-1" id="eAD-br-oBB"/>
+ </connections>
+ </menuItem>
<menuItem title="Custom Style…" id="L0h-86-2cU">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
@@ -643,7 +653,7 @@ CA
<rect key="frame" x="0.0" y="0.0" width="350" height="84"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
- <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="0IK-AW-Gg3">
+ <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0IK-AW-Gg3">
<rect key="frame" x="18" y="45" width="89" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Access token:" id="Ptd-FI-M5A">
<font key="font" metaFont="system"/>
@@ -654,7 +664,7 @@ CA
<accessibilityConnection property="link" destination="7sb-sf-oJU" id="U0t-jC-oQ7"/>
</connections>
</textField>
- <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7sb-sf-oJU">
+ <textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7sb-sf-oJU">
<rect key="frame" x="113" y="42" width="197" height="22"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="jlV-TC-NUv">
<font key="font" metaFont="system"/>
@@ -723,7 +733,7 @@ CA
<rect key="frame" x="-1" y="20" width="402" height="281"/>
<clipView key="contentView" id="J9U-Yx-o2S">
<rect key="frame" x="1" y="0.0" width="400" height="280"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <autoresizingMask key="autoresizingMask"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" autosaveColumns="NO" headerView="MAZ-Iq-hBi" id="Ato-Vu-HYT">
<rect key="frame" x="0.0" y="0.0" width="423" height="257"/>
diff --git a/platform/macos/app/Base.lproj/MapDocument.xib b/platform/macos/app/Base.lproj/MapDocument.xib
index 065acc41fd..d95f21b2e9 100644
--- a/platform/macos/app/Base.lproj/MapDocument.xib
+++ b/platform/macos/app/Base.lproj/MapDocument.xib
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="12118" systemVersion="16E195" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
- <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="12118"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="12120"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -48,7 +48,7 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="388" y="211" width="642" height="480"/>
- <rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
+ <rect key="screenRect" x="0.0" y="0.0" width="1280" height="777"/>
<view key="contentView" id="TuG-C5-zLS">
<rect key="frame" x="0.0" y="0.0" width="642" height="480"/>
<autoresizingMask key="autoresizingMask"/>
@@ -183,9 +183,9 @@
<toolbarItem implicitItemIdentifier="BA3542AF-D63A-4893-9CC7-8F67EF2E82B0" label="Style" paletteLabel="Style" id="u23-0z-Otl" customClass="ValidatedToolbarItem">
<nil key="toolTip"/>
<size key="minSize" width="100" height="26"/>
- <size key="maxSize" width="120" height="26"/>
+ <size key="maxSize" width="150" height="26"/>
<popUpButton key="view" verticalHuggingPriority="750" id="Tzm-Cy-dQg">
- <rect key="frame" x="0.0" y="14" width="120" height="26"/>
+ <rect key="frame" x="0.0" y="14" width="150" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="roundTextured" title="Streets" bezelStyle="texturedRounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="border" tag="1" imageScaling="proportionallyDown" inset="2" selectedItem="wvt-tP-O3a" id="3PJ-qK-Oh3">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -204,6 +204,12 @@
<menuItem title="Satellite Streets" tag="6" id="7ly-oA-0ND">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
+ <menuItem title="Traffic Day" tag="7" id="Vz7-9Z-EFq">
+ <modifierMask key="keyEquivalentModifierMask"/>
+ </menuItem>
+ <menuItem title="Traffic Night" tag="8" id="zh7-LM-dmF">
+ <modifierMask key="keyEquivalentModifierMask"/>
+ </menuItem>
</items>
</menu>
</popUpButtonCell>
diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m
index 5be17c1cbe..59c1817f63 100644
--- a/platform/macos/app/MapDocument.m
+++ b/platform/macos/app/MapDocument.m
@@ -165,22 +165,28 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio
NSURL *styleURL;
switch (tag) {
case 1:
- styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion];
+ styleURL = [MGLStyle streetsStyleURL];
break;
case 2:
- styleURL = [MGLStyle outdoorsStyleURLWithVersion:MGLStyleDefaultVersion];
+ styleURL = [MGLStyle outdoorsStyleURL];
break;
case 3:
- styleURL = [MGLStyle lightStyleURLWithVersion:MGLStyleDefaultVersion];
+ styleURL = [MGLStyle lightStyleURL];
break;
case 4:
- styleURL = [MGLStyle darkStyleURLWithVersion:MGLStyleDefaultVersion];
+ styleURL = [MGLStyle darkStyleURL];
break;
case 5:
- styleURL = [MGLStyle satelliteStyleURLWithVersion:MGLStyleDefaultVersion];
+ styleURL = [MGLStyle satelliteStyleURL];
break;
case 6:
- styleURL = [MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleDefaultVersion];
+ styleURL = [MGLStyle satelliteStreetsStyleURL];
+ break;
+ case 7:
+ styleURL = [MGLStyle trafficDayStyleURL];
+ break;
+ case 8:
+ styleURL = [MGLStyle trafficNightStyleURL];
break;
default:
NSAssert(NO, @"Cannot set style from control with tag %li", (long)tag);
@@ -781,22 +787,25 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio
NSCellStateValue state;
switch (menuItem.tag) {
case 1:
- state = [styleURL isEqual:[MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion]];
+ state = [styleURL isEqual:[MGLStyle streetsStyleURL]];
break;
case 2:
- state = [styleURL isEqual:[MGLStyle outdoorsStyleURLWithVersion:MGLStyleDefaultVersion]];
+ state = [styleURL isEqual:[MGLStyle outdoorsStyleURL]];
break;
case 3:
- state = [styleURL isEqual:[MGLStyle lightStyleURLWithVersion:MGLStyleDefaultVersion]];
+ state = [styleURL isEqual:[MGLStyle lightStyleURL]];
break;
case 4:
- state = [styleURL isEqual:[MGLStyle darkStyleURLWithVersion:MGLStyleDefaultVersion]];
+ state = [styleURL isEqual:[MGLStyle darkStyleURL]];
break;
case 5:
- state = [styleURL isEqual:[MGLStyle satelliteStyleURLWithVersion:MGLStyleDefaultVersion]];
+ state = [styleURL isEqual:[MGLStyle satelliteStyleURL]];
break;
case 6:
- state = [styleURL isEqual:[MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleDefaultVersion]];
+ state = [styleURL isEqual:[MGLStyle satelliteStreetsStyleURL]];
+ break;
+ case 7:
+ state = [styleURL isEqual:[MGLStyle trafficDayStyleURL]];
break;
default:
return NO;
@@ -954,12 +963,14 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio
}
NSArray *styleURLs = @[
- [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion],
- [MGLStyle outdoorsStyleURLWithVersion:MGLStyleDefaultVersion],
- [MGLStyle lightStyleURLWithVersion:MGLStyleDefaultVersion],
- [MGLStyle darkStyleURLWithVersion:MGLStyleDefaultVersion],
- [MGLStyle satelliteStyleURLWithVersion:MGLStyleDefaultVersion],
- [MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleDefaultVersion],
+ [MGLStyle streetsStyleURL],
+ [MGLStyle outdoorsStyleURL],
+ [MGLStyle lightStyleURL],
+ [MGLStyle darkStyleURL],
+ [MGLStyle satelliteStyleURL],
+ [MGLStyle satelliteStreetsStyleURL],
+ [MGLStyle trafficDayStyleURL],
+ [MGLStyle trafficNightStyleURL],
];
return [styleURLs indexOfObject:self.mapView.styleURL];
}