summaryrefslogtreecommitdiff
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-11 18:57:39 -0700
commit4d6f54553d277c0af24a0b8ff03d2dd7e9284ca2 (patch)
tree40f1de50c3092d71f679c4341bd290daa46ec06e
parent9e384b78fbcf46d66d390122eefdf273f91b314e (diff)
downloadqtlocation-mapboxgl-4d6f54553d277c0af24a0b8ff03d2dd7e9284ca2.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.
-rw-r--r--platform/android/CHANGELOG.md1
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/Style.java20
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/res/values/strings.xml2
-rw-r--r--platform/darwin/src/MGLStyle.h62
-rw-r--r--platform/darwin/src/MGLStyle.mm4
-rw-r--r--platform/darwin/test/MGLStyleTests.mm12
-rw-r--r--platform/default/mbgl/util/default_styles.cpp2
-rw-r--r--platform/default/mbgl/util/default_styles.hpp3
-rw-r--r--platform/ios/CHANGELOG.md1
-rw-r--r--platform/ios/app/MBXViewController.m16
-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
14 files changed, 170 insertions, 39 deletions
diff --git a/platform/android/CHANGELOG.md b/platform/android/CHANGELOG.md
index 4f12907f38..fdc6343b7c 100644
--- a/platform/android/CHANGELOG.md
+++ b/platform/android/CHANGELOG.md
@@ -37,6 +37,7 @@ Mapbox welcomes participation and contributions from everyone. If you'd like to
* Derived source attribution [#8630](https://github.com/mapbox/mapbox-gl-native/pull/8630)
* Consistent use of duration unit [#8578](https://github.com/mapbox/mapbox-gl-native/pull/8578)
* Swedish localization [#8883](https://github.com/mapbox/mapbox-gl-native/pull/8883)
+* Streets v10, Outdoors v10, Satellite Streets v10, Traffic Day v2, Traffic Night v2 [#6301](https://github.com/mapbox/mapbox-gl-native/pull/6301)
## 5.0.2 - April 3, 2017
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/Style.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/Style.java
index fae3bdde2c..77d0929df3 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/Style.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/Style.java
@@ -23,7 +23,7 @@ public class Style {
* constants means your map style will always use the latest version and may change as we
* improve the style
*/
- @StringDef( {MAPBOX_STREETS, OUTDOORS, LIGHT, DARK, SATELLITE, SATELLITE_STREETS})
+ @StringDef( {MAPBOX_STREETS, OUTDOORS, LIGHT, DARK, SATELLITE, SATELLITE_STREETS, TRAFFIC_DAY, TRAFFIC_NIGHT})
@Retention(RetentionPolicy.SOURCE)
public @interface StyleUrl {
}
@@ -67,4 +67,22 @@ public class Style {
* improve the style.
*/
public static final String SATELLITE_STREETS = "mapbox://styles/mapbox/satellite-streets-v10";
+
+ /**
+ * Traffic Day: Color-coded roads based on live traffic congestion data. Traffic data is currently
+ * available in
+ * <a href="https://www.mapbox.com/api-documentation/pages/traffic-countries.html">these select
+ * countries</a>. Using this constant means your map style will always use the latest version and
+ * may change as we improve the style.
+ */
+ public static final String TRAFFIC_DAY = "mapbox://styles/mapbox/traffic-day-v2";
+
+ /**
+ * Traffic Night: Color-coded roads based on live traffic congestion data, designed to maximize
+ * legibility in low-light situations. Traffic data is currently available in
+ * <a href="https://www.mapbox.com/api-documentation/pages/traffic-countries.html">these select
+ * countries</a>. Using this constant means your map style will always use the latest version and
+ * may change as we improve the style.
+ */
+ public static final String TRAFFIC_NIGHT = "mapbox://styles/mapbox/traffic-night-v2";
}
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/values/strings.xml b/platform/android/MapboxGLAndroidSDK/src/main/res/values/strings.xml
index 7adc29e2de..65fb3e14a3 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/res/values/strings.xml
+++ b/platform/android/MapboxGLAndroidSDK/src/main/res/values/strings.xml
@@ -24,4 +24,6 @@
<string name="mapbox_style_dark" translatable="false">mapbox://styles/mapbox/dark-v9</string>
<string name="mapbox_style_satellite" translatable="false">mapbox://styles/mapbox/satellite-v9</string>
<string name="mapbox_style_satellite_streets" translatable="false">mapbox://styles/mapbox/satellite-streets-v10</string>
+ <string name="mapbox_style_traffic_day" translatable="false">mapbox://styles/mapbox/traffic-day-v2</string>
+ <string name="mapbox_style_traffic_night" translatable="false">mapbox://styles/mapbox/traffic-night-v2</string>
</resources>
diff --git a/platform/darwin/src/MGLStyle.h b/platform/darwin/src/MGLStyle.h
index 49898a1863..26434eb492 100644
--- a/platform/darwin/src/MGLStyle.h
+++ b/platform/darwin/src/MGLStyle.h
@@ -231,6 +231,68 @@ MGL_EXPORT
*/
+ (NSURL *)satelliteStreetsStyleURLWithVersion:(NSInteger)version;
+/**
+ Returns the URL to the current version of the
+ <a href="https://www.mapbox.com/blog/live-traffic-maps/">Mapbox Traffic Day</a>
+ style.
+
+ Traffic Day color-codes roads based on live traffic congestion data. Traffic
+ data is currently available in
+ <a href="https://www.mapbox.com/api-documentation/pages/traffic-countries.html">these select countries</a>.
+
+ @warning The return value may change in a future release of the SDK. If you use
+ any feature that depends on a specific aspect of a default style – for
+ instance, the minimum zoom level that includes roads – use the
+ `-trafficDayStyleURLWithVersion:` method instead. Such details may change
+ significantly from version to version.
+ */
++ (NSURL *)trafficDayStyleURL;
+
+/**
+ Returns the URL to the given version of the
+ <a href="https://www.mapbox.com/blog/live-traffic-maps/">Mapbox Traffic Day</a>
+ style as of publication.
+
+ Traffic Day color-codes roads based on live traffic congestion data. Traffic
+ data is currently available in
+ <a href="https://www.mapbox.com/api-documentation/pages/traffic-countries.html">these select countries</a>.
+
+ @param version A specific version of the style.
+ */
++ (NSURL *)trafficDayStyleURLWithVersion:(NSInteger)version;
+
+/**
+ Returns the URL to the current version of the
+ <a href="https://www.mapbox.com/blog/live-traffic-maps/">Mapbox Traffic Night</a>
+ style.
+
+ Traffic Night color-codes roads based on live traffic congestion data and is
+ designed to maximize legibility in low-light situations. Traffic data is
+ currently available in
+ <a href="https://www.mapbox.com/api-documentation/pages/traffic-countries.html">these select countries</a>.
+
+ @warning The return value may change in a future release of the SDK. If you use
+ any feature that depends on a specific aspect of a default style – for
+ instance, the minimum zoom level that includes roads – use the
+ `-trafficNightStyleURLWithVersion:` method instead. Such details may change
+ significantly from version to version.
+ */
++ (NSURL *)trafficNightStyleURL;
+
+/**
+ Returns the URL to the given version of the
+ <a href="https://www.mapbox.com/blog/live-traffic-maps/">Mapbox Traffic Night</a>
+ style as of publication.
+
+ Traffic Night color-codes roads based on live traffic congestion data and is
+ designed to maximize legibility in low-light situations. Traffic data is
+ currently available in
+ <a href="https://www.mapbox.com/api-documentation/pages/traffic-countries.html">these select countries</a>.
+
+ @param version A specific version of the style.
+ */
++ (NSURL *)trafficNightStyleURLWithVersion:(NSInteger)version;
+
#pragma mark Accessing Metadata About the Style
/**
diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm
index ce9e55bb99..af02c31b6d 100644
--- a/platform/darwin/src/MGLStyle.mm
+++ b/platform/darwin/src/MGLStyle.mm
@@ -80,10 +80,12 @@ MGL_DEFINE_STYLE(light, light)
MGL_DEFINE_STYLE(dark, dark)
MGL_DEFINE_STYLE(satellite, satellite)
MGL_DEFINE_STYLE(satelliteStreets, satellite-streets)
+MGL_DEFINE_STYLE(trafficDay, traffic-day)
+MGL_DEFINE_STYLE(trafficNight, traffic-night)
// Make sure all the styles listed in mbgl::util::default_styles::orderedStyles
// are defined above and also declared in MGLStyle.h.
-static_assert(6 == mbgl::util::default_styles::numOrderedStyles,
+static_assert(8 == mbgl::util::default_styles::numOrderedStyles,
"mbgl::util::default_styles::orderedStyles and MGLStyle have different numbers of styles.");
// Hybrid has been renamed Satellite Streets, so the last Hybrid version is hard-coded here.
diff --git a/platform/darwin/test/MGLStyleTests.mm b/platform/darwin/test/MGLStyleTests.mm
index a2ad1cbb3f..f80d5776f0 100644
--- a/platform/darwin/test/MGLStyleTests.mm
+++ b/platform/darwin/test/MGLStyleTests.mm
@@ -99,8 +99,16 @@
@(mbgl::util::default_styles::satelliteStreets.url));
XCTAssertEqualObjects([MGLStyle satelliteStreetsStyleURLWithVersion:99].absoluteString,
@"mapbox://styles/mapbox/satellite-streets-v99");
-
- static_assert(6 == mbgl::util::default_styles::numOrderedStyles,
+ XCTAssertEqualObjects([MGLStyle trafficDayStyleURLWithVersion:mbgl::util::default_styles::trafficDay.currentVersion].absoluteString,
+ @(mbgl::util::default_styles::trafficDay.url));
+ XCTAssertEqualObjects([MGLStyle trafficDayStyleURLWithVersion:99].absoluteString,
+ @"mapbox://styles/mapbox/traffic-day-v99");
+ XCTAssertEqualObjects([MGLStyle trafficNightStyleURLWithVersion:mbgl::util::default_styles::trafficNight.currentVersion].absoluteString,
+ @(mbgl::util::default_styles::trafficNight.url));
+ XCTAssertEqualObjects([MGLStyle trafficNightStyleURLWithVersion:99].absoluteString,
+ @"mapbox://styles/mapbox/traffic-night-v99");
+
+ static_assert(8 == mbgl::util::default_styles::numOrderedStyles,
"MGLStyleTests isn’t testing all the styles in mbgl::util::default_styles.");
}
diff --git a/platform/default/mbgl/util/default_styles.cpp b/platform/default/mbgl/util/default_styles.cpp
index e051817ada..5f4ca862fe 100644
--- a/platform/default/mbgl/util/default_styles.cpp
+++ b/platform/default/mbgl/util/default_styles.cpp
@@ -10,6 +10,8 @@ const DefaultStyle light = { "mapbox://styles/mapbox/light-v9",
const DefaultStyle dark = { "mapbox://styles/mapbox/dark-v9", "Dark", 9 };
const DefaultStyle satellite = { "mapbox://styles/mapbox/satellite-v9", "Satellite", 9 };
const DefaultStyle satelliteStreets = { "mapbox://styles/mapbox/satellite-streets-v10", "Satellite Streets", 10 };
+const DefaultStyle trafficDay = { "mapbox://styles/mapbox/traffic-day-v2", "Traffic Day", 2 };
+const DefaultStyle trafficNight = { "mapbox://styles/mapbox/traffic-night-v2", "Traffic Night", 2 };
} // namespace default_styles
} // end namespace util
diff --git a/platform/default/mbgl/util/default_styles.hpp b/platform/default/mbgl/util/default_styles.hpp
index 5e0d083d82..466102d623 100644
--- a/platform/default/mbgl/util/default_styles.hpp
+++ b/platform/default/mbgl/util/default_styles.hpp
@@ -19,9 +19,12 @@ extern const DefaultStyle light;
extern const DefaultStyle dark;
extern const DefaultStyle satellite;
extern const DefaultStyle satelliteStreets;
+extern const DefaultStyle trafficDay;
+extern const DefaultStyle trafficNight;
const DefaultStyle orderedStyles[] = {
streets, outdoors, light, dark, satellite, satelliteStreets,
+ trafficDay, trafficNight,
};
const size_t numOrderedStyles = sizeof(orderedStyles) / sizeof(DefaultStyle);
diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md
index b975030b1b..922b7b6486 100644
--- a/platform/ios/CHANGELOG.md
+++ b/platform/ios/CHANGELOG.md
@@ -8,6 +8,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT
* 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/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m
index 3e61ec8ddc..7cbe9d594f 100644
--- a/platform/ios/app/MBXViewController.m
+++ b/platform/ios/app/MBXViewController.m
@@ -1542,14 +1542,18 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
@"Dark",
@"Satellite",
@"Satellite Streets",
+ @"Traffic Day",
+ @"Traffic Night",
];
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],
];
NSAssert(styleNames.count == styleURLs.count, @"Style names and URLs don’t match.");
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];
}