From 981413c7c4ed73e538b0830b926829691778ef70 Mon Sep 17 00:00:00 2001 From: Antonio Zugaldia Date: Wed, 1 Mar 2017 15:18:59 -0500 Subject: [android] [auto] Update properties to version 5.0.0-beta.2 in preparation for build. --- platform/android/MapboxGLAndroidSDK/gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform') diff --git a/platform/android/MapboxGLAndroidSDK/gradle.properties b/platform/android/MapboxGLAndroidSDK/gradle.properties index dac39fa60a..81ea7e7423 100644 --- a/platform/android/MapboxGLAndroidSDK/gradle.properties +++ b/platform/android/MapboxGLAndroidSDK/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.mapbox.mapboxsdk -VERSION_NAME=5.0.0-SNAPSHOT +VERSION_NAME=5.0.0-beta.2 POM_DESCRIPTION=Mapbox GL Android SDK POM_URL=https://github.com/mapbox/mapbox-gl-native -- cgit v1.2.1 From db778658449484fdaa00722e931a24b3124b369a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Wed, 1 Mar 2017 11:19:13 -0800 Subject: [ios, macos] Updated changelogs for #8113 --- platform/ios/CHANGELOG.md | 3 ++- platform/macos/CHANGELOG.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'platform') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 33da2715f2..15c7b2e84c 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -9,7 +9,8 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Added support for right-to-left text and Arabic ligatures in labels. ([#6984](https://github.com/mapbox/mapbox-gl-native/pull/6984), [#7123](https://github.com/mapbox/mapbox-gl-native/pull/7123)) * Improved the line wrapping behavior of point-placed labels, especially labels written in Chinese and Japanese. ([#6828](https://github.com/mapbox/mapbox-gl-native/pull/6828), [#7446](https://github.com/mapbox/mapbox-gl-native/pull/7446)) * CJK characters now remain upright in vertically oriented labels that have line placement, such as road labels. ([#7114](https://github.com/mapbox/mapbox-gl-native/issues/7114)) -* Added Chinese (Simplified and Traditional), French, German, Japanese, Lithuanian, Polish, Portuguese (Brazilian), Russian, Spanish, Swedish, Ukrainian, and Vietnamese localizations. ([#7316](https://github.com/mapbox/mapbox-gl-native/pull/7316), [#7899](https://github.com/mapbox/mapbox-gl-native/pull/7899), [#7999](https://github.com/mapbox/mapbox-gl-native/pull/7999)) +* Added Chinese (Simplified and Traditional), French, German, Japanese, Lithuanian, Polish, Portuguese (Brazilian), Russian, Spanish, Swedish, Ukrainian, and Vietnamese localizations. ([#7316](https://github.com/mapbox/mapbox-gl-native/pull/7316), [#7899](https://github.com/mapbox/mapbox-gl-native/pull/7899), [#7999](https://github.com/mapbox/mapbox-gl-native/pull/7999), +[#8113](https://github.com/mapbox/mapbox-gl-native/pull/8113)) ### Styles diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index 38711b5202..972622e403 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -7,7 +7,8 @@ * Added support for right-to-left text and Arabic ligatures in labels. ([#6984](https://github.com/mapbox/mapbox-gl-native/pull/6984), [#7123](https://github.com/mapbox/mapbox-gl-native/pull/7123)) * Improved the line wrapping behavior of point-placed labels, especially labels written in Chinese and Japanese. ([#6828](https://github.com/mapbox/mapbox-gl-native/pull/6828), [#7446](https://github.com/mapbox/mapbox-gl-native/pull/7446)) * CJK characters now remain upright in vertically oriented labels that have line placement, such as road labels. ([#7114](https://github.com/mapbox/mapbox-gl-native/issues/7114)) -* Added Chinese (Simplified and Traditional), French, German, Japanese, Lithuanian, Polish, Portuguese (Brazilian), Spanish, Swedish, Ukrainian, and Vietnamese localizations. ([#7316](https://github.com/mapbox/mapbox-gl-native/pull/7316), [#7503](https://github.com/mapbox/mapbox-gl-native/pull/7503), [#7899](https://github.com/mapbox/mapbox-gl-native/pull/7899), [#7999](https://github.com/mapbox/mapbox-gl-native/pull/7999)) +* Added Chinese (Simplified and Traditional), French, German, Japanese, Lithuanian, Polish, Portuguese (Brazilian), Spanish, Swedish, Ukrainian, and Vietnamese localizations. ([#7316](https://github.com/mapbox/mapbox-gl-native/pull/7316), [#7503](https://github.com/mapbox/mapbox-gl-native/pull/7503), [#7899](https://github.com/mapbox/mapbox-gl-native/pull/7899), [#7999](https://github.com/mapbox/mapbox-gl-native/pull/7999), +[#8113](https://github.com/mapbox/mapbox-gl-native/pull/8113)) ### Styles -- cgit v1.2.1 From 4705019ae379b8e7676898b64e26ac840b2babd3 Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Wed, 1 Mar 2017 12:59:53 -0800 Subject: [ios] Update podspec version for 3.5.0 beta.2 --- platform/ios/Mapbox-iOS-SDK-symbols.podspec | 2 +- platform/ios/Mapbox-iOS-SDK.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'platform') diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec index 24ff0f5e43..986a5855bf 100644 --- a/platform/ios/Mapbox-iOS-SDK-symbols.podspec +++ b/platform/ios/Mapbox-iOS-SDK-symbols.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '3.5.0-beta.1' + version = '3.5.0-beta.2' m.name = 'Mapbox-iOS-SDK-symbols' m.version = "#{version}-symbols" diff --git a/platform/ios/Mapbox-iOS-SDK.podspec b/platform/ios/Mapbox-iOS-SDK.podspec index 3509d9a30f..ca4c54f423 100644 --- a/platform/ios/Mapbox-iOS-SDK.podspec +++ b/platform/ios/Mapbox-iOS-SDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '3.5.0-beta.1' + version = '3.5.0-beta.2' m.name = 'Mapbox-iOS-SDK' m.version = version -- cgit v1.2.1 From 968bb369c9b578b48745d6c775c51503534a4f20 Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Wed, 1 Mar 2017 15:23:36 -0800 Subject: [ios] Use curl to verify that a release is not published The previous incantation is now failing due to redirects. Getting only the headers from curl and checkin the first line works reliably. --- platform/ios/scripts/deploy-packages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform') diff --git a/platform/ios/scripts/deploy-packages.sh b/platform/ios/scripts/deploy-packages.sh index 479803aa05..4a3c73295a 100755 --- a/platform/ios/scripts/deploy-packages.sh +++ b/platform/ios/scripts/deploy-packages.sh @@ -83,7 +83,7 @@ if [[ $( echo ${VERSION_TAG} | grep --invert-match ios-v ) ]]; then exit 1 fi -if [[ $( wget --spider -O- https://api.github.com/repos/${GITHUB_USER}/${GITHUB_REPO}/releases/tags/${VERSION_TAG} 2>&1 | grep -c "404 Not Found" ) == 0 ]]; then +if [[ $( curl --head https://api.github.com/repos/${GITHUB_USER}/${GITHUB_REPO}/releases/tags/${VERSION_TAG} | head -n 1 | grep -c "404 Not Found") == 0 ]]; then echo "Error: ${VERSION_TAG} has already been published on GitHub" echo "See: https://github.com/${GITHUB_USER}/${GITHUB_REPO}/releases/tag/${VERSION_TAG}" exit 1 -- cgit v1.2.1 From f1e3c32f7ea9e5a1d80b8ddd136751ca131c3eb5 Mon Sep 17 00:00:00 2001 From: Antonio Zugaldia Date: Thu, 2 Mar 2017 09:58:11 -0500 Subject: Updates version name and CHANGELOG after 5.0.0-beta.2 release (#8254) * go back to 5.0.0-SNAPSHOT * update changelog --- platform/android/CHANGELOG.md | 7 +++++++ platform/android/MapboxGLAndroidSDK/gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'platform') diff --git a/platform/android/CHANGELOG.md b/platform/android/CHANGELOG.md index 1186d392d0..831433803c 100644 --- a/platform/android/CHANGELOG.md +++ b/platform/android/CHANGELOG.md @@ -2,6 +2,13 @@ Mapbox welcomes participation and contributions from everyone. If you'd like to do so please see the [`Contributing Guide`](https://github.com/mapbox/mapbox-gl-native/blob/master/CONTRIBUTING.md) first to get started. +## 5.0.0-beta.2 - March 1st, 2017 + +5.0.0-beta.2 focuses on addressing stability issues and bug fixes. It also includes: + +* Data-driven styling for `{text,icon}-{color,opacity,halo-color,halo-blur,halo-width}` [#7939](https://github.com/mapbox/mapbox-gl-native/pull/7939) +* Additional APIs to manage runtime styling layers [#8195](https://github.com/mapbox/mapbox-gl-native/pull/8195) + ## 5.0.0-beta.1 - February 14th, 2017 * Support for data-driven styles [#7752](https://github.com/mapbox/mapbox-gl-native/pull/7752) diff --git a/platform/android/MapboxGLAndroidSDK/gradle.properties b/platform/android/MapboxGLAndroidSDK/gradle.properties index 81ea7e7423..dac39fa60a 100644 --- a/platform/android/MapboxGLAndroidSDK/gradle.properties +++ b/platform/android/MapboxGLAndroidSDK/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.mapbox.mapboxsdk -VERSION_NAME=5.0.0-beta.2 +VERSION_NAME=5.0.0-SNAPSHOT POM_DESCRIPTION=Mapbox GL Android SDK POM_URL=https://github.com/mapbox/mapbox-gl-native -- cgit v1.2.1 From d25e2c772daeb44f3933a0114f41c86b9679e8c1 Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Thu, 16 Feb 2017 19:46:00 -0800 Subject: [ios, macos] Rename MGLStyleConstantValue to MGLConstantStyleValue --- .../darwin/docs/guides/For Style Authors.md.ejs | 2 +- platform/darwin/scripts/generate-style-code.js | 4 +- platform/darwin/src/MGLBackgroundStyleLayer.h | 8 +- platform/darwin/src/MGLCircleStyleLayer.h | 26 ++--- platform/darwin/src/MGLFillStyleLayer.h | 20 ++-- platform/darwin/src/MGLLineStyleLayer.h | 32 +++--- platform/darwin/src/MGLRasterStyleLayer.h | 14 +-- platform/darwin/src/MGLStyleValue.h | 24 ++--- platform/darwin/src/MGLStyleValue.mm | 6 +- platform/darwin/src/MGLStyleValue_Private.h | 42 ++++---- platform/darwin/src/MGLSymbolStyleLayer.h | 114 ++++++++++----------- platform/darwin/test/MGLStyleValueTests.swift | 24 ++--- platform/ios/app/MBXViewController.m | 30 +++--- platform/ios/docs/guides/For Style Authors.md | 2 +- platform/macos/app/MapDocument.m | 6 +- platform/macos/docs/guides/For Style Authors.md | 2 +- 16 files changed, 178 insertions(+), 178 deletions(-) (limited to 'platform') diff --git a/platform/darwin/docs/guides/For Style Authors.md.ejs b/platform/darwin/docs/guides/For Style Authors.md.ejs index 254a7cf219..60797967d0 100644 --- a/platform/darwin/docs/guides/For Style Authors.md.ejs +++ b/platform/darwin/docs/guides/For Style Authors.md.ejs @@ -254,7 +254,7 @@ In style JSON | In Objective-C | In Swift ## Setting attribute values Each property representing a layout or paint attribute is set to an -`MGLStyleValue` object, which is either an `MGLStyleConstantValue` object (for +`MGLStyleValue` object, which is either an `MGLConstantStyleValue` object (for constant values) or an `MGLStyleFunction` object (for zoom level functions). The style value object is a container for the raw value or function parameters that you want the attribute to be set to. diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js index cacca57700..9746c11408 100644 --- a/platform/darwin/scripts/generate-style-code.js +++ b/platform/darwin/scripts/generate-style-code.js @@ -184,7 +184,7 @@ global.testGetterImplementation = function (property, layerType, isFunction) { if (isFunction) { return `XCTAssertEqualObjects(gLayer.${objCName(property)}, ${value});`; } - return `XCTAssert([gLayer.${objCName(property)} isKindOfClass:[MGLStyleConstantValue class]]); + return `XCTAssert([gLayer.${objCName(property)} isKindOfClass:[MGLConstantStyleValue class]]); XCTAssertEqualObjects(gLayer.${objCName(property)}, ${value});`; } return `XCTAssertEqualObjects(gLayer.${objCName(property)}, ${value});`; @@ -281,7 +281,7 @@ global.propertyDoc = function (propertyName, property, layerType, kind) { doc += `\n\nThis attribute corresponds to the ${property.original} layout property in the Mapbox Style Specification.`; } doc += '\n\nYou can set this property to an instance of:\n\n' + - '* `MGLStyleConstantValue`\n'; + '* `MGLConstantStyleValue`\n'; if (property["property-function"]) { doc += '* `MGLCameraStyleFunction` with an interpolation mode of:\n' + ' * `MGLInterpolationModeExponential`\n' + diff --git a/platform/darwin/src/MGLBackgroundStyleLayer.h b/platform/darwin/src/MGLBackgroundStyleLayer.h index c6fd6113cb..0d0eccd685 100644 --- a/platform/darwin/src/MGLBackgroundStyleLayer.h +++ b/platform/darwin/src/MGLBackgroundStyleLayer.h @@ -41,7 +41,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -60,7 +60,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -77,7 +77,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -91,7 +91,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ diff --git a/platform/darwin/src/MGLCircleStyleLayer.h b/platform/darwin/src/MGLCircleStyleLayer.h index b3e9ee7161..7a64c25a23 100644 --- a/platform/darwin/src/MGLCircleStyleLayer.h +++ b/platform/darwin/src/MGLCircleStyleLayer.h @@ -91,7 +91,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -117,7 +117,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -142,7 +142,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -168,7 +168,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -195,7 +195,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -224,7 +224,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -242,7 +242,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -267,7 +267,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -293,7 +293,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -321,7 +321,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -353,7 +353,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -375,7 +375,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -401,7 +401,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h index a5baf2308c..32b62344c7 100644 --- a/platform/darwin/src/MGLFillStyleLayer.h +++ b/platform/darwin/src/MGLFillStyleLayer.h @@ -67,7 +67,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -88,7 +88,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -116,7 +116,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -143,7 +143,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -169,7 +169,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -194,7 +194,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -217,7 +217,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -239,7 +239,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -261,7 +261,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -287,7 +287,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ diff --git a/platform/darwin/src/MGLLineStyleLayer.h b/platform/darwin/src/MGLLineStyleLayer.h index 23a1f8f131..7cfa27e1cc 100644 --- a/platform/darwin/src/MGLLineStyleLayer.h +++ b/platform/darwin/src/MGLLineStyleLayer.h @@ -118,7 +118,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -133,7 +133,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -152,7 +152,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -172,7 +172,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -192,7 +192,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -221,7 +221,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -249,7 +249,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -282,7 +282,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -302,7 +302,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -332,7 +332,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -357,7 +357,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -379,7 +379,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -401,7 +401,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -423,7 +423,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -449,7 +449,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -468,7 +468,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` diff --git a/platform/darwin/src/MGLRasterStyleLayer.h b/platform/darwin/src/MGLRasterStyleLayer.h index 9e876a6e3c..edd88c319d 100644 --- a/platform/darwin/src/MGLRasterStyleLayer.h +++ b/platform/darwin/src/MGLRasterStyleLayer.h @@ -52,7 +52,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -75,7 +75,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -93,7 +93,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -111,7 +111,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -133,7 +133,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -151,7 +151,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -167,7 +167,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` diff --git a/platform/darwin/src/MGLStyleValue.h b/platform/darwin/src/MGLStyleValue.h index 2ce2eae89a..97ab0ddba3 100644 --- a/platform/darwin/src/MGLStyleValue.h +++ b/platform/darwin/src/MGLStyleValue.h @@ -33,7 +33,7 @@ typedef NSString *MGLStyleFunctionOption NS_STRING_ENUM; extern MGL_EXPORT const MGLStyleFunctionOption MGLStyleFunctionOptionInterpolationBase; /** - An `MGLStyleConstantValue` object that specifies a default value that a style + An `MGLConstantStyleValue` object that specifies a default value that a style function can use when it can't otherwise determine a value. A default value can be used to set the value of a style layer property that @@ -81,7 +81,7 @@ typedef NS_ENUM(NSUInteger, MGLInterpolationMode) { `MGLStyleValue` objects. The `MGLStyleValue` class itself represents a class cluster. Under the hood, a - particular `MGLStyleValue` object may be either an `MGLStyleConstantValue` to + particular `MGLStyleValue` object may be either an `MGLConstantStyleValue` to represent a constant value or one of the concrete subclasses of `MGLStyleFunction` to represent a value function. Do not initialize an `MGLStyleValue` object directly; instead, use one of the class factory methods @@ -104,10 +104,10 @@ MGL_EXPORT #pragma mark Creating a Style Value /** - Creates and returns an `MGLStyleConstantValue` object containing a raw value. + Creates and returns an `MGLConstantStyleValue` object containing a raw value. @param rawValue The constant value contained by the object. - @return An `MGLStyleConstantValue` object containing `rawValue`, which is + @return An `MGLConstantStyleValue` object containing `rawValue`, which is treated as a constant value. */ + (instancetype)valueWithRawValue:(T)rawValue; @@ -181,24 +181,24 @@ MGL_EXPORT @end /** - An `MGLStyleConstantValue` object is a generic container for a style attribute + An `MGLConstantStyleValue` object is a generic container for a style attribute value that remains constant as the zoom level changes. The layout and paint attribute properties of `MGLStyleLayer` objects can be set to - `MGLStyleConstantValue` objects. + `MGLConstantStyleValue` objects. - The `MGLStyleConstantValue` class takes a generic parameter `T` that indicates + The `MGLConstantStyleValue` class takes a generic parameter `T` that indicates the Foundation class being wrapped by this class. */ MGL_EXPORT -@interface MGLStyleConstantValue : MGLStyleValue +@interface MGLConstantStyleValue : MGLStyleValue #pragma mark Creating a Style Constant Value /** - Creates and returns an `MGLStyleConstantValue` object containing a raw value. + Creates and returns an `MGLConstantStyleValue` object containing a raw value. @param rawValue The constant value contained by the object. - @return An `MGLStyleConstantValue` object containing `rawValue`, which is + @return An `MGLConstantStyleValue` object containing `rawValue`, which is treated as a constant value. */ + (instancetype)valueWithRawValue:(T)rawValue; @@ -208,10 +208,10 @@ MGL_EXPORT - (instancetype)init NS_UNAVAILABLE; /** - Returns an `MGLStyleConstantValue` object containing a raw value. + Returns an `MGLConstantStyleValue` object containing a raw value. @param rawValue The value contained by the receiver. - @return An `MGLStyleConstantValue` object containing `rawValue`. + @return An `MGLConstantStyleValue` object containing `rawValue`. */ - (instancetype)initWithRawValue:(T)rawValue NS_DESIGNATED_INITIALIZER; diff --git a/platform/darwin/src/MGLStyleValue.mm b/platform/darwin/src/MGLStyleValue.mm index 020dc27d6a..33b6babadf 100644 --- a/platform/darwin/src/MGLStyleValue.mm +++ b/platform/darwin/src/MGLStyleValue.mm @@ -6,7 +6,7 @@ const MGLStyleFunctionOption MGLStyleFunctionOptionDefaultValue = @"MGLStyleFunc @implementation MGLStyleValue + (instancetype)valueWithRawValue:(id)rawValue { - return [MGLStyleConstantValue valueWithRawValue:rawValue]; + return [MGLConstantStyleValue valueWithRawValue:rawValue]; } + (instancetype)valueWithInterpolationBase:(CGFloat)interpolationBase stops:(NSDictionary *)stops { @@ -31,7 +31,7 @@ const MGLStyleFunctionOption MGLStyleFunctionOptionDefaultValue = @"MGLStyleFunc @end -@implementation MGLStyleConstantValue +@implementation MGLConstantStyleValue + (instancetype)valueWithRawValue:(id)rawValue { return [[self alloc] initWithRawValue:rawValue]; @@ -52,7 +52,7 @@ const MGLStyleFunctionOption MGLStyleFunctionOptionDefaultValue = @"MGLStyleFunc return [self.rawValue debugDescription]; } -- (BOOL)isEqual:(MGLStyleConstantValue *)other { +- (BOOL)isEqual:(MGLConstantStyleValue *)other { return [other isKindOfClass:[self class]] && [other.rawValue isEqual:self.rawValue]; } diff --git a/platform/darwin/src/MGLStyleValue_Private.h b/platform/darwin/src/MGLStyleValue_Private.h index 3a5ce8d474..0cc30cb6c4 100644 --- a/platform/darwin/src/MGLStyleValue_Private.h +++ b/platform/darwin/src/MGLStyleValue_Private.h @@ -55,8 +55,8 @@ public: return {}; } - if ([value isKindOfClass:[MGLStyleConstantValue class]]) { - return toMBGLConstantValue((MGLStyleConstantValue *)value); + if ([value isKindOfClass:[MGLConstantStyleValue class]]) { + return toMBGLConstantValue((MGLConstantStyleValue *)value); } else if ([value isKindOfClass:[MGLCameraStyleFunction class]]) { MGLCameraStyleFunction *cameraStyleFunction = (MGLCameraStyleFunction *)value; // Intentionally ignore the stop type set by the developer becuase non interpolatable property values @@ -86,8 +86,8 @@ public: return {}; } - if ([value isKindOfClass:[MGLStyleConstantValue class]]) { - return toMBGLConstantValue((MGLStyleConstantValue *)value); + if ([value isKindOfClass:[MGLConstantStyleValue class]]) { + return toMBGLConstantValue((MGLConstantStyleValue *)value); } else if ([value isMemberOfClass:[MGLStyleFunction class]]) { MGLStyleFunction *styleFunction = (MGLStyleFunction *)value; return toMBGLExponentialCameraFunction(styleFunction); @@ -119,8 +119,8 @@ public: // Convert an mgl style value into a mbgl data driven property value mbgl::style::DataDrivenPropertyValue toDataDrivenPropertyValue(MGLStyleValue *value) { - if ([value isKindOfClass:[MGLStyleConstantValue class]]) { - return toMBGLConstantValue((MGLStyleConstantValue *)value); + if ([value isKindOfClass:[MGLConstantStyleValue class]]) { + return toMBGLConstantValue((MGLConstantStyleValue *)value); } else if ([value isKindOfClass:[MGLStyleFunction class]]) { auto rawValue = toRawStyleSpecValue((MGLStyleFunction *) value); auto result = mbgl::style::conversion::convert>(rawValue); @@ -143,9 +143,9 @@ public: return {}; } - if ([value isKindOfClass:[MGLStyleConstantValue class]]) { + if ([value isKindOfClass:[MGLConstantStyleValue class]]) { MBGLEnum mbglValue; - getMBGLValue([(MGLStyleConstantValue *)value rawValue], mbglValue); + getMBGLValue([(MGLConstantStyleValue *)value rawValue], mbglValue); return mbglValue; } else if ([value isKindOfClass:[MGLCameraStyleFunction class]]) { MGLCameraStyleFunction *cameraStyleFunction = (MGLCameraStyleFunction *)value; @@ -175,7 +175,7 @@ public: private: // Private utilities for converting from mgl to mbgl values - MBGLType toMBGLConstantValue(MGLStyleConstantValue *value) { + MBGLType toMBGLConstantValue(MGLConstantStyleValue *value) { MBGLType mbglValue; getMBGLValue(value.rawValue, mbglValue); return mbglValue; @@ -245,7 +245,7 @@ private: // Private utilities for converting from mgl to mbgl values if ([styleFunction isKindOfClass:[MGLCameraStyleFunction class]]) { // zoom-only function (no default value) __block NSMutableArray *stops = [[NSMutableArray alloc] init]; - [styleFunction.stops enumerateKeysAndObjectsUsingBlock:^(NSNumber * _Nonnull zoomKey, MGLStyleConstantValue * _Nonnull outputValue, BOOL * _Nonnull stop) { + [styleFunction.stops enumerateKeysAndObjectsUsingBlock:^(NSNumber * _Nonnull zoomKey, MGLConstantStyleValue * _Nonnull outputValue, BOOL * _Nonnull stop) { MBGLType dummyMbglValue; NSArray *rawStop = @[zoomKey, toRawStyleSpecValue([outputValue rawValue], dummyMbglValue)]; [stops addObject:rawStop]; @@ -257,7 +257,7 @@ private: // Private utilities for converting from mgl to mbgl values rawFunction[@"property"] = sourceStyleFunction.attributeName; // property-only function __block NSMutableArray *stops = [[NSMutableArray alloc] init]; - [styleFunction.stops enumerateKeysAndObjectsUsingBlock:^(NSObject * _Nonnull propertyKey, MGLStyleConstantValue * _Nonnull outputValue, BOOL * _Nonnull stop) { + [styleFunction.stops enumerateKeysAndObjectsUsingBlock:^(NSObject * _Nonnull propertyKey, MGLConstantStyleValue * _Nonnull outputValue, BOOL * _Nonnull stop) { MBGLType dummyMbglValue; NSArray *rawStop = @[propertyKey, toRawStyleSpecValue([outputValue rawValue], dummyMbglValue)]; [stops addObject:rawStop]; @@ -266,9 +266,9 @@ private: // Private utilities for converting from mgl to mbgl values // defaultValue => default if (sourceStyleFunction.defaultValue) { - NSCAssert([sourceStyleFunction.defaultValue isKindOfClass:[MGLStyleConstantValue class]], @"Default value must be constant"); + NSCAssert([sourceStyleFunction.defaultValue isKindOfClass:[MGLConstantStyleValue class]], @"Default value must be constant"); MBGLType dummyMbglValue; - rawFunction[@"default"] = toRawStyleSpecValue([(MGLStyleConstantValue *)sourceStyleFunction.defaultValue rawValue], dummyMbglValue); + rawFunction[@"default"] = toRawStyleSpecValue([(MGLConstantStyleValue *)sourceStyleFunction.defaultValue rawValue], dummyMbglValue); } } else if ([styleFunction isKindOfClass:[MGLCompositeStyleFunction class]]) { // zoom-and-property function @@ -282,8 +282,8 @@ private: // Private utilities for converting from mgl to mbgl values @"zoom": zoomKey, @"value": valueKey }; - MGLStyleConstantValue *outputValue = stopValue[valueKey]; - NSCAssert([outputValue isKindOfClass:[MGLStyleConstantValue class]], @"Stop outputs should be MGLStyleConstantValues"); + MGLConstantStyleValue *outputValue = stopValue[valueKey]; + NSCAssert([outputValue isKindOfClass:[MGLConstantStyleValue class]], @"Stop outputs should be MGLConstantStyleValues"); MBGLType dummyMbglValue; NSArray *rawStop = @[stopKey, toRawStyleSpecValue([outputValue rawValue], dummyMbglValue)]; [stops addObject:rawStop]; @@ -293,9 +293,9 @@ private: // Private utilities for converting from mgl to mbgl values // defaultValue => default if (compositeStyleFunction.defaultValue) { - NSCAssert([compositeStyleFunction.defaultValue isKindOfClass:[MGLStyleConstantValue class]], @"Default value must be constant"); + NSCAssert([compositeStyleFunction.defaultValue isKindOfClass:[MGLConstantStyleValue class]], @"Default value must be constant"); MBGLType dummyMbglValue; - rawFunction[@"default"] = toRawStyleSpecValue([(MGLStyleConstantValue *)compositeStyleFunction.defaultValue rawValue], dummyMbglValue); + rawFunction[@"default"] = toRawStyleSpecValue([(MGLConstantStyleValue *)compositeStyleFunction.defaultValue rawValue], dummyMbglValue); } } @@ -367,9 +367,9 @@ private: // Private utilities for converting from mgl to mbgl values void setDefaultMBGLValue(MGLSourceStyleFunction *sourceStyleFunction, mbgl::style::SourceFunction &sourceFunction) { if (sourceStyleFunction.defaultValue) { - NSCAssert([sourceStyleFunction.defaultValue isKindOfClass:[MGLStyleConstantValue class]], @"Default value must be constant"); + NSCAssert([sourceStyleFunction.defaultValue isKindOfClass:[MGLConstantStyleValue class]], @"Default value must be constant"); MBGLType mbglValue; - id mglValue = [(MGLStyleConstantValue *)sourceStyleFunction.defaultValue rawValue]; + id mglValue = [(MGLConstantStyleValue *)sourceStyleFunction.defaultValue rawValue]; getMBGLValue(mglValue, mbglValue); sourceFunction.defaultValue = mbglValue; } @@ -518,7 +518,7 @@ private: // Private utilities for converting from mbgl to mgl values id operator()(const MBGLEnum &value) const { auto str = mbgl::Enum::toString(value); MGLEnum mglType = *mbgl::Enum::toEnum(str); - return [MGLStyleConstantValue valueWithRawValue:[NSValue value:&mglType withObjCType:@encode(MGLEnum)]]; + return [MGLConstantStyleValue valueWithRawValue:[NSValue value:&mglType withObjCType:@encode(MGLEnum)]]; } id operator()(const mbgl::style::CameraFunction &mbglValue) const { @@ -671,7 +671,7 @@ private: // Private utilities for converting from mbgl to mgl values id operator()(const MBGLType &value) const { auto rawValue = toMGLRawStyleValue(value); - return [MGLStyleConstantValue valueWithRawValue:rawValue]; + return [MGLConstantStyleValue valueWithRawValue:rawValue]; } id operator()(const mbgl::style::CameraFunction &mbglValue) const { diff --git a/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/darwin/src/MGLSymbolStyleLayer.h index a4850a4e18..47d140f91f 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.h +++ b/platform/darwin/src/MGLSymbolStyleLayer.h @@ -299,7 +299,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -324,7 +324,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -342,7 +342,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -364,7 +364,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -392,7 +392,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -422,7 +422,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -443,7 +443,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -468,7 +468,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -500,7 +500,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -522,7 +522,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -544,7 +544,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -567,7 +567,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -590,7 +590,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -617,7 +617,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -646,7 +646,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -674,7 +674,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -702,7 +702,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -728,7 +728,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -746,7 +746,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -767,7 +767,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -788,7 +788,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -824,7 +824,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -845,7 +845,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -877,7 +877,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -904,7 +904,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -930,7 +930,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -955,7 +955,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -978,7 +978,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -999,7 +999,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1021,7 +1021,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1042,7 +1042,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1063,7 +1063,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -1084,7 +1084,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1103,7 +1103,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -1127,7 +1127,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1150,7 +1150,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -1168,7 +1168,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1200,7 +1200,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1229,7 +1229,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1260,7 +1260,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1290,7 +1290,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1319,7 +1319,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1350,7 +1350,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1378,7 +1378,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1413,7 +1413,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1438,7 +1438,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1464,7 +1464,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ @@ -1485,7 +1485,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1513,7 +1513,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1544,7 +1544,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1573,7 +1573,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1601,7 +1601,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1633,7 +1633,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1661,7 +1661,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1696,7 +1696,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1721,7 +1721,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of: * `MGLInterpolationModeExponential` * `MGLInterpolationModeInterval` @@ -1747,7 +1747,7 @@ MGL_EXPORT You can set this property to an instance of: - * `MGLStyleConstantValue` + * `MGLConstantStyleValue` * `MGLCameraStyleFunction` with an interpolation mode of `MGLInterpolationModeInterval` */ diff --git a/platform/darwin/test/MGLStyleValueTests.swift b/platform/darwin/test/MGLStyleValueTests.swift index f965c31e40..784b2fbaf1 100644 --- a/platform/darwin/test/MGLStyleValueTests.swift +++ b/platform/darwin/test/MGLStyleValueTests.swift @@ -24,8 +24,8 @@ extension MGLStyleValueTests { return } - if let actualConstant = actual as? MGLStyleConstantValue { - assertColorsEqualWithAccuracy(actualConstant.rawValue, (expected as! MGLStyleConstantValue).rawValue) + if let actualConstant = actual as? MGLConstantStyleValue { + assertColorsEqualWithAccuracy(actualConstant.rawValue, (expected as! MGLConstantStyleValue).rawValue) } else if let actualFunction = actual as? MGLStyleFunction, let expectedFunction = expected as? MGLStyleFunction { @@ -55,11 +55,11 @@ extension MGLStyleValueTests { XCTFail("Expected stop value of type \(type(of: expectedValue)), but found \(type(of: actualValue)) instead.") return } - if let actualValue = actualValue as? MGLStyleConstantValue, - let expectedValue = expectedValue as? MGLStyleConstantValue { + if let actualValue = actualValue as? MGLConstantStyleValue, + let expectedValue = expectedValue as? MGLConstantStyleValue { assertColorsEqualWithAccuracy(actualValue.rawValue, expectedValue.rawValue) - } else if let actualValue = actualValue as? MGLStyleConstantValue, - let expectedValue = expectedValue as? MGLStyleConstantValue { + } else if let actualValue = actualValue as? MGLConstantStyleValue, + let expectedValue = expectedValue as? MGLConstantStyleValue { XCTAssertEqual(actualValue, expectedValue) } else { XCTFail("Unsupported stop value type \(type(of: actualValue)).") @@ -90,16 +90,16 @@ extension MGLStyleValueTests { let circleStyleLayer = MGLCircleStyleLayer(identifier: "circleLayer", source: shapeSource) // Boolean - symbolStyleLayer.iconAllowsOverlap = MGLStyleConstantValue(rawValue: true) - XCTAssertEqual((symbolStyleLayer.iconAllowsOverlap as! MGLStyleConstantValue).rawValue, true) + symbolStyleLayer.iconAllowsOverlap = MGLConstantStyleValue(rawValue: true) + XCTAssertEqual((symbolStyleLayer.iconAllowsOverlap as! MGLConstantStyleValue).rawValue, true) // Number - symbolStyleLayer.iconHaloWidth = MGLStyleConstantValue(rawValue: 3) - XCTAssertEqual((symbolStyleLayer.iconHaloWidth as! MGLStyleConstantValue).rawValue, 3) + symbolStyleLayer.iconHaloWidth = MGLConstantStyleValue(rawValue: 3) + XCTAssertEqual((symbolStyleLayer.iconHaloWidth as! MGLConstantStyleValue).rawValue, 3) // String - symbolStyleLayer.text = MGLStyleConstantValue(rawValue: "{name}") - XCTAssertEqual((symbolStyleLayer.text as! MGLStyleConstantValue).rawValue, "{name}") + symbolStyleLayer.text = MGLConstantStyleValue(rawValue: "{name}") + XCTAssertEqual((symbolStyleLayer.text as! MGLConstantStyleValue).rawValue, "{name}") var circleTranslationOne = CGVector(dx: 100, dy: 0) let circleTranslationValueOne = NSValue(bytes: &circleTranslationOne, objCType: "{CGVector=dd}") diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 63ca0ea1f6..e1ff440e9e 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -1020,8 +1020,8 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { [self.mapView.style addSource:source]; MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:queryLayerID source:source]; - fillLayer.fillColor = [MGLStyleConstantValue valueWithRawValue:[UIColor blueColor]]; - fillLayer.fillOpacity = [MGLStyleConstantValue valueWithRawValue:@0.5]; + fillLayer.fillColor = [MGLConstantStyleValue valueWithRawValue:[UIColor blueColor]]; + fillLayer.fillOpacity = [MGLConstantStyleValue valueWithRawValue:@0.5]; [self.mapView.style addLayer:fillLayer]; }); } @@ -1272,19 +1272,19 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { [self.mapView.style addSource:routeSource]; MGLLineStyleLayer *baseRouteLayer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"style-base-route-layer" source:routeSource]; - baseRouteLayer.lineColor = [MGLStyleConstantValue valueWithRawValue:[UIColor orangeColor]]; - baseRouteLayer.lineWidth = [MGLStyleConstantValue valueWithRawValue:@20]; - baseRouteLayer.lineOpacity = [MGLStyleConstantValue valueWithRawValue:@0.5]; - baseRouteLayer.lineCap = [MGLStyleConstantValue valueWithRawValue:[NSValue valueWithMGLLineCap:MGLLineCapRound]]; - baseRouteLayer.lineJoin = [MGLStyleConstantValue valueWithRawValue:[NSValue valueWithMGLLineJoin:MGLLineJoinRound]]; + baseRouteLayer.lineColor = [MGLConstantStyleValue valueWithRawValue:[UIColor orangeColor]]; + baseRouteLayer.lineWidth = [MGLConstantStyleValue valueWithRawValue:@20]; + baseRouteLayer.lineOpacity = [MGLConstantStyleValue valueWithRawValue:@0.5]; + baseRouteLayer.lineCap = [MGLConstantStyleValue valueWithRawValue:[NSValue valueWithMGLLineCap:MGLLineCapRound]]; + baseRouteLayer.lineJoin = [MGLConstantStyleValue valueWithRawValue:[NSValue valueWithMGLLineJoin:MGLLineJoinRound]]; [self.mapView.style addLayer:baseRouteLayer]; MGLLineStyleLayer *routeLayer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"style-route-layer" source:routeSource]; - routeLayer.lineColor = [MGLStyleConstantValue valueWithRawValue:[UIColor whiteColor]]; - routeLayer.lineWidth = [MGLStyleConstantValue valueWithRawValue:@15]; - routeLayer.lineOpacity = [MGLStyleConstantValue valueWithRawValue:@0.8]; - routeLayer.lineCap = [MGLStyleConstantValue valueWithRawValue:[NSValue valueWithMGLLineCap:MGLLineCapRound]]; - routeLayer.lineJoin = [MGLStyleConstantValue valueWithRawValue:[NSValue valueWithMGLLineJoin:MGLLineJoinRound]]; + routeLayer.lineColor = [MGLConstantStyleValue valueWithRawValue:[UIColor whiteColor]]; + routeLayer.lineWidth = [MGLConstantStyleValue valueWithRawValue:@15]; + routeLayer.lineOpacity = [MGLConstantStyleValue valueWithRawValue:@0.8]; + routeLayer.lineCap = [MGLConstantStyleValue valueWithRawValue:[NSValue valueWithMGLLineCap:MGLLineCapRound]]; + routeLayer.lineJoin = [MGLConstantStyleValue valueWithRawValue:[NSValue valueWithMGLLineJoin:MGLLineJoinRound]]; [self.mapView.style addLayer:routeLayer]; } @@ -1340,8 +1340,8 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { MGLSymbolStyleLayer *layer = (MGLSymbolStyleLayer *)[self.mapView.style layerWithIdentifier:layerName]; if ([layer isKindOfClass:[MGLSymbolStyleLayer class]]) { - if ([layer.text isKindOfClass:[MGLStyleConstantValue class]]) { - MGLStyleConstantValue *label = (MGLStyleConstantValue *)layer.text; + if ([layer.text isKindOfClass:[MGLConstantStyleValue class]]) { + MGLConstantStyleValue *label = (MGLConstantStyleValue *)layer.text; if ([label.rawValue hasPrefix:@"{name"]) { layer.text = [MGLStyleValue valueWithRawValue:language]; } @@ -1349,7 +1349,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { else if ([layer.text isKindOfClass:[MGLCameraStyleFunction class]]) { MGLCameraStyleFunction *function = (MGLCameraStyleFunction *)layer.text; NSMutableDictionary *stops = function.stops.mutableCopy; - [stops enumerateKeysAndObjectsUsingBlock:^(NSNumber *zoomLevel, MGLStyleConstantValue *stop, BOOL *done) { + [stops enumerateKeysAndObjectsUsingBlock:^(NSNumber *zoomLevel, MGLConstantStyleValue *stop, BOOL *done) { if ([stop.rawValue hasPrefix:@"{name"]) { stops[zoomLevel] = [MGLStyleValue valueWithRawValue:language]; } diff --git a/platform/ios/docs/guides/For Style Authors.md b/platform/ios/docs/guides/For Style Authors.md index a65d07bdd1..c1c74499b2 100644 --- a/platform/ios/docs/guides/For Style Authors.md +++ b/platform/ios/docs/guides/For Style Authors.md @@ -252,7 +252,7 @@ In style JSON | In Objective-C | In Swift ## Setting attribute values Each property representing a layout or paint attribute is set to an -`MGLStyleValue` object, which is either an `MGLStyleConstantValue` object (for +`MGLStyleValue` object, which is either an `MGLConstantStyleValue` object (for constant values) or an `MGLStyleFunction` object (for zoom level functions). The style value object is a container for the raw value or function parameters that you want the attribute to be set to. diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m index 39055d7447..b120f2da6d 100644 --- a/platform/macos/app/MapDocument.m +++ b/platform/macos/app/MapDocument.m @@ -369,14 +369,14 @@ NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id *)layer.text rawValue]; + if ([layer.text isKindOfClass:[MGLConstantStyleValue class]]) { + NSString *textField = [(MGLConstantStyleValue *)layer.text rawValue]; layer.text = [MGLStyleValue valueWithRawValue:stringByLocalizingString(textField)]; } else if ([layer.text isKindOfClass:[MGLCameraStyleFunction class]]) { MGLCameraStyleFunction *function = (MGLCameraStyleFunction *)layer.text; NSMutableDictionary *stops = function.stops.mutableCopy; - [stops enumerateKeysAndObjectsUsingBlock:^(NSNumber *zoomLevel, MGLStyleConstantValue *stop, BOOL *done) { + [stops enumerateKeysAndObjectsUsingBlock:^(NSNumber *zoomLevel, MGLConstantStyleValue *stop, BOOL *done) { NSString *textField = stop.rawValue; stops[zoomLevel] = [MGLStyleValue valueWithRawValue:stringByLocalizingString(textField)]; }]; diff --git a/platform/macos/docs/guides/For Style Authors.md b/platform/macos/docs/guides/For Style Authors.md index 78a3063b06..a0cf39e6dc 100644 --- a/platform/macos/docs/guides/For Style Authors.md +++ b/platform/macos/docs/guides/For Style Authors.md @@ -241,7 +241,7 @@ In style JSON | In Objective-C | In Swift ## Setting attribute values Each property representing a layout or paint attribute is set to an -`MGLStyleValue` object, which is either an `MGLStyleConstantValue` object (for +`MGLStyleValue` object, which is either an `MGLConstantStyleValue` object (for constant values) or an `MGLStyleFunction` object (for zoom level functions). The style value object is a container for the raw value or function parameters that you want the attribute to be set to. -- cgit v1.2.1 From 4e074aa4db232dbc1c8497a82c927f6ee37d984e Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Thu, 16 Feb 2017 20:06:00 -0800 Subject: [ios, macos] Alias MGLStyleConstantValue to MGLConstantStyleValue --- platform/darwin/src/MGLStyleValue.h | 2 ++ platform/ios/CHANGELOG.md | 1 + platform/macos/CHANGELOG.md | 1 + 3 files changed, 4 insertions(+) (limited to 'platform') diff --git a/platform/darwin/src/MGLStyleValue.h b/platform/darwin/src/MGLStyleValue.h index 97ab0ddba3..4afdbece64 100644 --- a/platform/darwin/src/MGLStyleValue.h +++ b/platform/darwin/src/MGLStyleValue.h @@ -224,6 +224,8 @@ MGL_EXPORT @end +@compatibility_alias MGLStyleConstantValue MGLConstantStyleValue; + /** An `MGLStyleFunction` is a is an abstract superclass for functions that are defined by an `MGLCameraStyleFunction`, `MGLSourceStyleFunction`, or diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 15c7b2e84c..5e73f345d3 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -29,6 +29,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Fixed an issue causing vector style layer predicates to be evaluated as if each feature had a `$type` attribute of 1, 2, or 3. The `$type` key path can now be compared to `Point`, `LineString`, or `Polygon`, as described in the documentation. ([#7971](https://github.com/mapbox/mapbox-gl-native/pull/7971)) * When setting an `MGLShapeSource`’s shape to an `MGLFeature` instance, any `UIColor` attribute value is now converted to the equivalent CSS string representation for use with `MGLInterpolationModeIdentity` in style functions. ([#8025](https://github.com/mapbox/mapbox-gl-native/pull/8025)) * An exception is no longer thrown if layers or sources are removed from a style before they are added. ([#7962](https://github.com/mapbox/mapbox-gl-native/pull/7962)) +* Renamed MGLStyleConstantValue to MGLConstantStyleValue. For compatibility with previous releases, MGLStyleConstantValue is now an alias of MGLConstantStyleValue. ([#8090](https://github.com/mapbox/mapbox-gl-native/pull/8090)) ### User interaction diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index 972622e403..9cf0bef5b6 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -27,6 +27,7 @@ * Fixed an issue causing vector style layer predicates to be evaluated as if each feature had a `$type` attribute of 1, 2, or 3. The `$type` key path can now be compared to `Point`, `LineString`, or `Polygon`, as described in the documentation. ([#7971](https://github.com/mapbox/mapbox-gl-native/pull/7971)) * When setting an `MGLShapeSource`’s shape to an `MGLFeature` instance, any `NSColor` attribute value is now converted to the equivalent CSS string representation for use with `MGLInterpolationModeIdentity` in style functions. ([#8025](https://github.com/mapbox/mapbox-gl-native/pull/8025)) * An exception is no longer thrown if layers or sources are removed from a style before they are added. ([#7962](https://github.com/mapbox/mapbox-gl-native/pull/7962)) +* Renamed MGLStyleConstantValue to MGLConstantStyleValue. For compatibility with previous releases, MGLStyleConstantValue is now an alias of MGLConstantStyleValue. ([#8090](https://github.com/mapbox/mapbox-gl-native/pull/8090)) ### User interaction -- cgit v1.2.1 From d31df7c4f6f134fea84fa8cbd4bdaaae49f11592 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Wed, 1 Mar 2017 15:13:04 -0800 Subject: [ios] Added basic notes about using Carthage --- platform/ios/CHANGELOG.md | 1 + platform/ios/INSTALL.md | 12 ++++++++++++ 2 files changed, 13 insertions(+) (limited to 'platform') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 5e73f345d3..aa03f1810e 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -48,6 +48,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT ### Other changes * The minimum deployment target for this SDK is now iOS 8. ([#8129](https://github.com/mapbox/mapbox-gl-native/pull/8129)) +* Added support for the Carthage dependency manager. See [our website](https://www.mapbox.com/ios-sdk/) for setup instructions. ([#8257](https://github.com/mapbox/mapbox-gl-native/pull/8257)) * Fixed an issue that, among other things, caused various islands to disappear at certain zoom levels. ([#7621](https://github.com/mapbox/mapbox-gl-native/pull/7621)) * Fixed an issue where translucent, non-view-backed point annotations along tile boundaries would be drawn darker than expected. ([#6832](https://github.com/mapbox/mapbox-gl-native/pull/6832)) * Fixed flickering that occurred when panning past the antimeridian. ([#7574](https://github.com/mapbox/mapbox-gl-native/pull/7574)) diff --git a/platform/ios/INSTALL.md b/platform/ios/INSTALL.md index 3d50ab868f..c93ab6b698 100644 --- a/platform/ios/INSTALL.md +++ b/platform/ios/INSTALL.md @@ -99,6 +99,18 @@ pod 'Mapbox-iOS-SDK', podspec: 'https://raw.githubusercontent.com/mapbox/mapbox- If using the static framework, add `$(inherited)` to your target’s Other Linker Flags in the Build Settings tab. +#### Carthage + +For instructions on installing stable release versions of the Mapbox iOS SDK with Carthage, see [our website](https://www.mapbox.com/ios-sdk/). If you require a build without symbols pre-stripped, use [this feed URL](https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK-symbols.json) with Carthage. + +##### Testing pre-releases with Carthage + +Carthage currently does not support pre-release versions of binaries. + +##### Using your own build with Carthage + +This project does not support being compiled as a local repository by Carthage. + ### Configuration 1. Mapbox vector tiles require a Mapbox account and API access token. In the project editor, select the application target, then go to the Info tab. Under the “Custom iOS Target Properties” section, set `MGLMapboxAccessToken` to your access token. You can obtain an access token from the [Mapbox account page](https://www.mapbox.com/studio/account/tokens/). -- cgit v1.2.1 From e15db9bb6aba082522553ff1d5c501f1745112b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Fri, 3 Mar 2017 03:32:30 -0800 Subject: [ios] Split out changelog Packaging section --- platform/ios/CHANGELOG.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'platform') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index aa03f1810e..0579edf5f6 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -4,6 +4,11 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT ## master +### Packaging + +* The minimum deployment target for this SDK is now iOS 8. ([#8129](https://github.com/mapbox/mapbox-gl-native/pull/8129)) +* Added support for the Carthage dependency manager. See [our website](https://www.mapbox.com/ios-sdk/) for setup instructions. ([#8257](https://github.com/mapbox/mapbox-gl-native/pull/8257)) + ### Internationalization * Added support for right-to-left text and Arabic ligatures in labels. ([#6984](https://github.com/mapbox/mapbox-gl-native/pull/6984), [#7123](https://github.com/mapbox/mapbox-gl-native/pull/7123)) @@ -47,8 +52,6 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT ### Other changes -* The minimum deployment target for this SDK is now iOS 8. ([#8129](https://github.com/mapbox/mapbox-gl-native/pull/8129)) -* Added support for the Carthage dependency manager. See [our website](https://www.mapbox.com/ios-sdk/) for setup instructions. ([#8257](https://github.com/mapbox/mapbox-gl-native/pull/8257)) * Fixed an issue that, among other things, caused various islands to disappear at certain zoom levels. ([#7621](https://github.com/mapbox/mapbox-gl-native/pull/7621)) * Fixed an issue where translucent, non-view-backed point annotations along tile boundaries would be drawn darker than expected. ([#6832](https://github.com/mapbox/mapbox-gl-native/pull/6832)) * Fixed flickering that occurred when panning past the antimeridian. ([#7574](https://github.com/mapbox/mapbox-gl-native/pull/7574)) -- cgit v1.2.1 From 8f892757b5c644986a68133c96684393df800670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Fri, 3 Mar 2017 03:32:48 -0800 Subject: [macos] Document Carthage, CocoaPods installation --- platform/macos/CHANGELOG.md | 1 + platform/macos/docs/pod-README.md | 34 +++++++++++++++++++++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) (limited to 'platform') diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index 9cf0bef5b6..7f36b36cb6 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -45,6 +45,7 @@ ### Other changes +* Added support for the Carthage dependency manager. See [this SDK’s homepage](https://mapbox.github.io/mapbox-gl-native/macos/) for setup instructions. ([#8257](https://github.com/mapbox/mapbox-gl-native/pull/8257)) * Fixed an issue that, among other things, caused various islands to disappear at certain zoom levels. ([#7621](https://github.com/mapbox/mapbox-gl-native/pull/7621)) * Fixed an issue where translucent point annotations along tile boundaries would be drawn darker than expected. ([#6832](https://github.com/mapbox/mapbox-gl-native/pull/6832)) * Fixed flickering that occurred when panning past the antimeridian. ([#7574](https://github.com/mapbox/mapbox-gl-native/pull/7574)) diff --git a/platform/macos/docs/pod-README.md b/platform/macos/docs/pod-README.md index 33386340c6..f247277ca2 100644 --- a/platform/macos/docs/pod-README.md +++ b/platform/macos/docs/pod-README.md @@ -14,15 +14,43 @@ The Mapbox macOS SDK is compatible with macOS 10.10.0 and above for Cocoa applic ## Installation -1. Download the [latest Mapbox macOS SDK release](https://github.com/mapbox/mapbox-gl-native/releases/) from GitHub – look for a release that begins with “macos-”. (Alternatively, you can integrate the Mapbox macOS SDK into your application [using CocoaPods](https://cocoapods.org/pods/Mapbox-macOS-SDK). If you do use CocoaPods, skip the next step.) +There are three ways to install the Mapbox macOS SDK: + +### Manually + +1. Download the [latest Mapbox macOS SDK release](https://github.com/mapbox/mapbox-gl-native/releases/) from GitHub – look for a release that begins with “macos-”. 1. Open the project editor, select your application target, then go to the General tab. Drag Mapbox.framework into the “Embedded Binaries” section. (Don’t drag it into the “Linked Frameworks and Libraries” section; Xcode will add it there automatically.) In the sheet that appears, make sure “Copy items if needed” is checked, then click Finish. -1. Mapbox vector tiles require a Mapbox account and API access token. In the project editor, select the application target, then go to the Info tab. Under the “Custom macOS Application Target Properties” section, set `MGLMapboxAccessToken` to your access token. You can obtain an access token from the [Mapbox account page](https://www.mapbox.com/studio/account/tokens/). +### Via Carthage + +The Mapbox macOS SDK is a binary-only dependency, so you’ll need Carthage 0.19 or above. In your [Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#binary-only-frameworks), specify this dependency (plus an optional version requirement): + +``` +binary "https://mapbox.github.io/mapbox-gl-native/macos/Mapbox-macOS-SDK.json" +``` + +After running `carthage update`, you’ll find Mapbox.framework in the Carthage/Build/ folder. Follow [these instructions](https://github.com/Carthage/Carthage#if-youre-building-for-os-x) to integrate it into your project. + +### Via CocoaPods + +Create a [Podfile](https://guides.cocoapods.org/syntax/podfile.html) with the following specification: + +```rb +platform :osx, '10.10' + +target 'TargetNameForYourApp' do + pod 'Mapbox-iOS-SDK', '~> x.y' +end +``` + +where _x.y_ is the current version. In Terminal, run `pod install`. ## Usage -In a storyboard or XIB: +Mapbox vector tiles require a Mapbox account and API access token. In the project editor, select the application target, then go to the Info tab. Under the “Custom macOS Application Target Properties” section, set `MGLMapboxAccessToken` to your access token. You can obtain an access token from the [Mapbox account page](https://www.mapbox.com/studio/account/tokens/). + +Then, in a storyboard or XIB: 1. Add a view to your view controller or window. (Drag Custom View from the Object library to the View Controller scene on the Interface Builder canvas. In a XIB, drag it instead to the window on the canvas.) 2. In the Identity inspector, set the view’s custom class to `MGLMapView`. -- cgit v1.2.1 From 1f1cc131ea869eae57209bcc6ba74ddb3af14579 Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Fri, 3 Mar 2017 20:11:06 -0500 Subject: [ios] Fixed conversion between Duration and NSTimeInerval (#8276) --- platform/darwin/src/MGLStyle.mm | 10 +++++----- platform/darwin/src/NSDate+MGLAdditions.h | 12 ++++++++---- platform/darwin/src/NSDate+MGLAdditions.mm | 13 ++++++------- platform/darwin/test/MGLNSDateAdditionsTests.mm | 26 +++++++++++++++++++++++++ platform/ios/ios.xcodeproj/project.pbxproj | 4 ++++ platform/ios/src/MGLMapView.mm | 24 +++++++++++------------ platform/ios/test/MGLNSDateAdditionsTests.mm | 26 +++++++++++++++++++++++++ platform/macos/macos.xcodeproj/project.pbxproj | 4 ++++ platform/macos/src/MGLMapView.mm | 18 ++++++++--------- platform/macos/test/MGLNSDateAdditionsTests.mm | 26 +++++++++++++++++++++++++ 10 files changed, 126 insertions(+), 37 deletions(-) create mode 100644 platform/darwin/test/MGLNSDateAdditionsTests.mm create mode 100644 platform/ios/test/MGLNSDateAdditionsTests.mm create mode 100644 platform/macos/test/MGLNSDateAdditionsTests.mm (limited to 'platform') diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm index bcb8100800..be82e34cb4 100644 --- a/platform/darwin/src/MGLStyle.mm +++ b/platform/darwin/src/MGLStyle.mm @@ -502,7 +502,7 @@ static NSURL *MGLStyleURL_emerald; newAppliedClasses.push_back([appliedClass UTF8String]); } - mbgl::style::TransitionOptions transition { { MGLDurationInSecondsFromTimeInterval(transitionDuration) } }; + mbgl::style::TransitionOptions transition { { MGLDurationFromTimeInterval(transitionDuration) } }; self.mapView.mbglMap->setTransitionOptions(transition); self.mapView.mbglMap->setClasses(newAppliedClasses); } @@ -575,27 +575,27 @@ static NSURL *MGLStyleURL_emerald; - (void)setTransitionDuration:(NSTimeInterval)duration { auto transitionOptions = self.mapView.mbglMap->getTransitionOptions(); - transitionOptions.duration = MGLDurationInSecondsFromTimeInterval(duration); + transitionOptions.duration = MGLDurationFromTimeInterval(duration); self.mapView.mbglMap->setTransitionOptions(transitionOptions); } - (NSTimeInterval)transitionDuration { const mbgl::style::TransitionOptions transitionOptions = self.mapView.mbglMap->getTransitionOptions(); - return MGLTimeIntervalFromDurationInSeconds(transitionOptions.duration.value_or(mbgl::Duration::zero())); + return MGLTimeIntervalFromDuration(transitionOptions.duration.value_or(mbgl::Duration::zero())); } - (void)setTransitionDelay:(NSTimeInterval)delay { auto transitionOptions = self.mapView.mbglMap->getTransitionOptions(); - transitionOptions.delay = MGLDurationInSecondsFromTimeInterval(delay); + transitionOptions.delay = MGLDurationFromTimeInterval(delay); self.mapView.mbglMap->setTransitionOptions(transitionOptions); } - (NSTimeInterval)transitionDelay { const mbgl::style::TransitionOptions transitionOptions = self.mapView.mbglMap->getTransitionOptions(); - return MGLTimeIntervalFromDurationInSeconds(transitionOptions.delay.value_or(mbgl::Duration::zero())); + return MGLTimeIntervalFromDuration(transitionOptions.delay.value_or(mbgl::Duration::zero())); } - (NSString *)description diff --git a/platform/darwin/src/NSDate+MGLAdditions.h b/platform/darwin/src/NSDate+MGLAdditions.h index 820d1bd9e2..1da03fda62 100644 --- a/platform/darwin/src/NSDate+MGLAdditions.h +++ b/platform/darwin/src/NSDate+MGLAdditions.h @@ -1,13 +1,17 @@ #import +#import "MGLFoundation.h" #include -@interface NSDate (MGLAdditions) +NS_ASSUME_NONNULL_BEGIN + /// Converts from a duration in seconds to a duration object usable in mbgl. -mbgl::Duration MGLDurationInSecondsFromTimeInterval(NSTimeInterval duration); +MGL_EXPORT +mbgl::Duration MGLDurationFromTimeInterval(NSTimeInterval duration); /// Converts from an mbgl duration object to a duration in seconds. -NSTimeInterval MGLTimeIntervalFromDurationInSeconds(mbgl::Duration duration); +MGL_EXPORT +NSTimeInterval MGLTimeIntervalFromDuration(mbgl::Duration duration); -@end +NS_ASSUME_NONNULL_END diff --git a/platform/darwin/src/NSDate+MGLAdditions.mm b/platform/darwin/src/NSDate+MGLAdditions.mm index deac3c4881..1739805e7c 100644 --- a/platform/darwin/src/NSDate+MGLAdditions.mm +++ b/platform/darwin/src/NSDate+MGLAdditions.mm @@ -1,15 +1,14 @@ #import "NSDate+MGLAdditions.h" -@implementation NSDate (MGLAdditions) - -mbgl::Duration MGLDurationInSecondsFromTimeInterval(NSTimeInterval duration) +mbgl::Duration MGLDurationFromTimeInterval(NSTimeInterval duration) { return std::chrono::duration_cast(std::chrono::duration(duration)); } -NSTimeInterval MGLTimeIntervalFromDurationInSeconds(mbgl::Duration duration) +NSTimeInterval MGLTimeIntervalFromDuration(mbgl::Duration duration) { - return duration.count(); + std::chrono::nanoseconds nano(duration.count()); + std::chrono::seconds sec = std::chrono::duration_cast(nano); + + return sec.count(); } - -@end diff --git a/platform/darwin/test/MGLNSDateAdditionsTests.mm b/platform/darwin/test/MGLNSDateAdditionsTests.mm new file mode 100644 index 0000000000..474fe763ff --- /dev/null +++ b/platform/darwin/test/MGLNSDateAdditionsTests.mm @@ -0,0 +1,26 @@ +#import + +#include +#import "../../darwin/src/NSDate+MGLAdditions.h" + +using namespace std::chrono_literals; + +@interface MGLNSDateAdditionsTests : XCTestCase +@end + +@implementation MGLNSDateAdditionsTests + +- (void)testDurationToNSTimeInterval { + + NSTimeInterval timeInterval = 5; + mbgl::Duration duration = MGLDurationFromTimeInterval(timeInterval); + NSTimeInterval durationTimeInterval = MGLTimeIntervalFromDuration(duration); + + mbgl::Duration expectedDuration = 5s; + + XCTAssertEqual(timeInterval, durationTimeInterval); + XCTAssertEqual(timeInterval, MGLTimeIntervalFromDuration(expectedDuration)); + +} + +@end diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index 14548822c9..41cb092e27 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ 1753ED421E53CE6F00A9FD90 /* MGLConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1753ED411E53CE6F00A9FD90 /* MGLConversion.h */; }; 1753ED431E53CE6F00A9FD90 /* MGLConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1753ED411E53CE6F00A9FD90 /* MGLConversion.h */; }; + 1F131E341E6A35EC0055AF5B /* MGLNSDateAdditionsTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F131E331E6A35EC0055AF5B /* MGLNSDateAdditionsTests.mm */; }; 30E578171DAA85520050F07E /* UIImage+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E578111DAA7D690050F07E /* UIImage+MGLAdditions.h */; }; 30E578181DAA85520050F07E /* UIImage+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E578111DAA7D690050F07E /* UIImage+MGLAdditions.h */; }; 30E578191DAA855E0050F07E /* UIImage+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 30E578121DAA7D690050F07E /* UIImage+MGLAdditions.mm */; }; @@ -526,6 +527,7 @@ /* Begin PBXFileReference section */ 1753ED411E53CE6F00A9FD90 /* MGLConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLConversion.h; sourceTree = ""; }; + 1F131E331E6A35EC0055AF5B /* MGLNSDateAdditionsTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLNSDateAdditionsTests.mm; sourceTree = ""; }; 20DABE861DF78148007AC5FF /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Foundation.strings"; sourceTree = ""; }; 20DABE881DF78148007AC5FF /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; 20DABE8A1DF78149007AC5FF /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Root.strings"; sourceTree = ""; }; @@ -1175,6 +1177,7 @@ DA0CD58F1CF56F6A00A5F5A5 /* MGLFeatureTests.mm */, DA2E885C1CC0382C00F24E7B /* MGLGeometryTests.mm */, 35E208A61D24210F00EC9A46 /* MGLNSDataAdditionsTests.m */, + 1F131E331E6A35EC0055AF5B /* MGLNSDateAdditionsTests.mm */, DAE7DEC11E245455007505A6 /* MGLNSStringAdditionsTests.m */, DA2E885D1CC0382C00F24E7B /* MGLOfflinePackTests.m */, DA2E885E1CC0382C00F24E7B /* MGLOfflineRegionTests.m */, @@ -2070,6 +2073,7 @@ 40CFA6511D7875BB008103BD /* MGLShapeSourceTests.mm in Sources */, DA35A2C51CCA9F8300E826B2 /* MGLClockDirectionFormatterTests.m in Sources */, 35B8E08C1D6C8B5100E768D2 /* MGLPredicateTests.mm in Sources */, + 1F131E341E6A35EC0055AF5B /* MGLNSDateAdditionsTests.mm in Sources */, DD58A4C61D822BD000E1F038 /* MGLExpressionTests.mm in Sources */, 3575798B1D502B0C000B822E /* MGLBackgroundStyleLayerTests.mm in Sources */, DA2E88621CC0382C00F24E7B /* MGLOfflinePackTests.m in Sources */, diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 7119544158..401055341d 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1237,7 +1237,7 @@ public: if (![self.delegate respondsToSelector:@selector(mapView:shouldChangeFromCamera:toCamera:)] || [self.delegate mapView:self shouldChangeFromCamera:oldCamera toCamera:toCamera]) { - _mbglMap->moveBy({ offset.x, offset.y }, MGLDurationInSecondsFromTimeInterval(self.decelerationRate)); + _mbglMap->moveBy({ offset.x, offset.y }, MGLDurationFromTimeInterval(self.decelerationRate)); } } @@ -1346,7 +1346,7 @@ public: } else { if (drift) { - _mbglMap->setScale(newScale, mbgl::ScreenCoordinate { centerPoint.x, centerPoint.y }, MGLDurationInSecondsFromTimeInterval(duration)); + _mbglMap->setScale(newScale, mbgl::ScreenCoordinate { centerPoint.x, centerPoint.y }, MGLDurationFromTimeInterval(duration)); } } @@ -1418,7 +1418,7 @@ public: if (![self.delegate respondsToSelector:@selector(mapView:shouldChangeFromCamera:toCamera:)] || [self.delegate mapView:self shouldChangeFromCamera:oldCamera toCamera:toCamera]) { - _mbglMap->setBearing(newDegrees, mbgl::ScreenCoordinate { centerPoint.x, centerPoint.y }, MGLDurationInSecondsFromTimeInterval(decelerationRate)); + _mbglMap->setBearing(newDegrees, mbgl::ScreenCoordinate { centerPoint.x, centerPoint.y }, MGLDurationFromTimeInterval(decelerationRate)); [self notifyGestureDidEndWithDrift:YES]; @@ -1558,7 +1558,7 @@ public: [self trackGestureEvent:MGLEventGestureDoubleTap forRecognizer:doubleTap]; mbgl::ScreenCoordinate center(gesturePoint.x, gesturePoint.y); - _mbglMap->setZoom(newZoom, center, MGLDurationInSecondsFromTimeInterval(MGLAnimationDuration)); + _mbglMap->setZoom(newZoom, center, MGLDurationFromTimeInterval(MGLAnimationDuration)); __weak MGLMapView *weakSelf = self; @@ -1596,7 +1596,7 @@ public: [self.delegate mapView:self shouldChangeFromCamera:oldCamera toCamera:toCamera]) { mbgl::ScreenCoordinate center(gesturePoint.x, gesturePoint.y); - _mbglMap->setZoom(newZoom, center, MGLDurationInSecondsFromTimeInterval(MGLAnimationDuration)); + _mbglMap->setZoom(newZoom, center, MGLDurationFromTimeInterval(MGLAnimationDuration)); __weak MGLMapView *weakSelf = self; @@ -2426,7 +2426,7 @@ public: mbgl::AnimationOptions animationOptions; if (duration) { - animationOptions.duration.emplace(MGLDurationInSecondsFromTimeInterval(duration)); + animationOptions.duration.emplace(MGLDurationFromTimeInterval(duration)); animationOptions.easing.emplace(MGLUnitBezierForMediaTimingFunction(function)); } if (completion) @@ -2481,7 +2481,7 @@ public: _mbglMap->setZoom(zoomLevel, MGLEdgeInsetsFromNSEdgeInsets(self.contentInset), - MGLDurationInSecondsFromTimeInterval(duration)); + MGLDurationFromTimeInterval(duration)); } - (void)setMinimumZoomLevel:(double)minimumZoomLevel @@ -2590,7 +2590,7 @@ public: mbgl::AnimationOptions animationOptions; if (duration > 0) { - animationOptions.duration.emplace(MGLDurationInSecondsFromTimeInterval(duration)); + animationOptions.duration.emplace(MGLDurationFromTimeInterval(duration)); animationOptions.easing.emplace(MGLUnitBezierForMediaTimingFunction(function)); } if (completion) @@ -2653,13 +2653,13 @@ public: { _mbglMap->setBearing(direction, MGLEdgeInsetsFromNSEdgeInsets(self.contentInset), - MGLDurationInSecondsFromTimeInterval(duration)); + MGLDurationFromTimeInterval(duration)); } else { CGPoint centerPoint = self.userLocationAnnotationViewCenter; _mbglMap->setBearing(direction, mbgl::ScreenCoordinate { centerPoint.x, centerPoint.y }, - MGLDurationInSecondsFromTimeInterval(duration)); + MGLDurationFromTimeInterval(duration)); } } @@ -2704,7 +2704,7 @@ public: mbgl::AnimationOptions animationOptions; if (duration > 0) { - animationOptions.duration.emplace(MGLDurationInSecondsFromTimeInterval(duration)); + animationOptions.duration.emplace(MGLDurationFromTimeInterval(duration)); animationOptions.easing.emplace(MGLUnitBezierForMediaTimingFunction(function)); } if (completion) @@ -2754,7 +2754,7 @@ public: mbgl::AnimationOptions animationOptions; if (duration >= 0) { - animationOptions.duration = MGLDurationInSecondsFromTimeInterval(duration); + animationOptions.duration = MGLDurationFromTimeInterval(duration); } if (peakAltitude >= 0) { diff --git a/platform/ios/test/MGLNSDateAdditionsTests.mm b/platform/ios/test/MGLNSDateAdditionsTests.mm new file mode 100644 index 0000000000..474fe763ff --- /dev/null +++ b/platform/ios/test/MGLNSDateAdditionsTests.mm @@ -0,0 +1,26 @@ +#import + +#include +#import "../../darwin/src/NSDate+MGLAdditions.h" + +using namespace std::chrono_literals; + +@interface MGLNSDateAdditionsTests : XCTestCase +@end + +@implementation MGLNSDateAdditionsTests + +- (void)testDurationToNSTimeInterval { + + NSTimeInterval timeInterval = 5; + mbgl::Duration duration = MGLDurationFromTimeInterval(timeInterval); + NSTimeInterval durationTimeInterval = MGLTimeIntervalFromDuration(duration); + + mbgl::Duration expectedDuration = 5s; + + XCTAssertEqual(timeInterval, durationTimeInterval); + XCTAssertEqual(timeInterval, MGLTimeIntervalFromDuration(expectedDuration)); + +} + +@end diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj index b5c54d8b2a..47647eba25 100644 --- a/platform/macos/macos.xcodeproj/project.pbxproj +++ b/platform/macos/macos.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 1753ED401E53CE6100A9FD90 /* MGLConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1753ED3F1E53CE5200A9FD90 /* MGLConversion.h */; }; + 1F131E361E6A36170055AF5B /* MGLNSDateAdditionsTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F131E351E6A36170055AF5B /* MGLNSDateAdditionsTests.mm */; }; 30E5781B1DAA857E0050F07E /* NSImage+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E578141DAA7D920050F07E /* NSImage+MGLAdditions.h */; }; 3508EC641D749D39009B0EE4 /* NSExpression+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3508EC621D749D39009B0EE4 /* NSExpression+MGLAdditions.h */; }; 3508EC651D749D39009B0EE4 /* NSExpression+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3508EC631D749D39009B0EE4 /* NSExpression+MGLAdditions.mm */; }; @@ -263,6 +264,7 @@ /* Begin PBXFileReference section */ 1753ED3F1E53CE5200A9FD90 /* MGLConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLConversion.h; sourceTree = ""; }; + 1F131E351E6A36170055AF5B /* MGLNSDateAdditionsTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLNSDateAdditionsTests.mm; sourceTree = ""; }; 30E578141DAA7D920050F07E /* NSImage+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSImage+MGLAdditions.h"; path = "src/NSImage+MGLAdditions.h"; sourceTree = SOURCE_ROOT; }; 3508EC621D749D39009B0EE4 /* NSExpression+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSExpression+MGLAdditions.h"; sourceTree = ""; }; 3508EC631D749D39009B0EE4 /* NSExpression+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSExpression+MGLAdditions.mm"; sourceTree = ""; }; @@ -944,6 +946,7 @@ DA35A2A71CC9F41600E826B2 /* MGLCoordinateFormatterTests.m */, DA2987591E1A4290002299F5 /* MGLDocumentationExampleTests.swift */, DD58A4C71D822C6200E1F038 /* MGLExpressionTests.mm */, + 1F131E351E6A36170055AF5B /* MGLNSDateAdditionsTests.mm */, 35C6DF861E214C1800ACA483 /* MGLDistanceFormatterTests.m */, DA0CD58D1CF56F5800A5F5A5 /* MGLFeatureTests.mm */, DAE6C3C81CC34BD800DB3429 /* MGLGeometryTests.mm */, @@ -1403,6 +1406,7 @@ DAE6C3D21CC34C9900DB3429 /* MGLGeometryTests.mm in Sources */, DA87A9A41DCACC5000810D09 /* MGLSymbolStyleLayerTests.mm in Sources */, 40E1601D1DF217D6005EA6D9 /* MGLStyleLayerTests.m in Sources */, + 1F131E361E6A36170055AF5B /* MGLNSDateAdditionsTests.mm in Sources */, DA87A9A61DCACC5000810D09 /* MGLCircleStyleLayerTests.mm in Sources */, DA87A99E1DC9DC2100810D09 /* MGLPredicateTests.mm in Sources */, DD58A4C91D822C6700E1F038 /* MGLExpressionTests.mm in Sources */, diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 827da35076..d70b5c0f03 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -980,7 +980,7 @@ public: [self willChangeValueForKey:@"centerCoordinate"]; _mbglMap->setLatLng(MGLLatLngFromLocationCoordinate2D(centerCoordinate), MGLEdgeInsetsFromNSEdgeInsets(self.contentInsets), - MGLDurationInSecondsFromTimeInterval(animated ? MGLAnimationDuration : 0)); + MGLDurationFromTimeInterval(animated ? MGLAnimationDuration : 0)); [self didChangeValueForKey:@"centerCoordinate"]; } @@ -989,7 +989,7 @@ public: _mbglMap->cancelTransitions(); MGLMapCamera *oldCamera = self.camera; _mbglMap->moveBy({ delta.x, delta.y }, - MGLDurationInSecondsFromTimeInterval(animated ? MGLAnimationDuration : 0)); + MGLDurationFromTimeInterval(animated ? MGLAnimationDuration : 0)); if ([self.delegate respondsToSelector:@selector(mapView:shouldChangeFromCamera:toCamera:)] && ![self.delegate mapView:self shouldChangeFromCamera:oldCamera toCamera:self.camera]) { self.camera = oldCamera; @@ -1029,7 +1029,7 @@ public: [self willChangeValueForKey:@"zoomLevel"]; _mbglMap->setZoom(zoomLevel, MGLEdgeInsetsFromNSEdgeInsets(self.contentInsets), - MGLDurationInSecondsFromTimeInterval(animated ? MGLAnimationDuration : 0)); + MGLDurationFromTimeInterval(animated ? MGLAnimationDuration : 0)); [self didChangeValueForKey:@"zoomLevel"]; } @@ -1043,7 +1043,7 @@ public: double newZoom = round(self.zoomLevel) + zoomDelta; MGLMapCamera *oldCamera = self.camera; mbgl::ScreenCoordinate center(point.x, self.bounds.size.height - point.y); - _mbglMap->setZoom(newZoom, center, MGLDurationInSecondsFromTimeInterval(animated ? MGLAnimationDuration : 0)); + _mbglMap->setZoom(newZoom, center, MGLDurationFromTimeInterval(animated ? MGLAnimationDuration : 0)); if ([self.delegate respondsToSelector:@selector(mapView:shouldChangeFromCamera:toCamera:)] && ![self.delegate mapView:self shouldChangeFromCamera:oldCamera toCamera:self.camera]) { self.camera = oldCamera; @@ -1057,7 +1057,7 @@ public: [self willChangeValueForKey:@"zoomLevel"]; MGLMapCamera *oldCamera = self.camera; mbgl::ScreenCoordinate center(point.x, self.bounds.size.height - point.y); - _mbglMap->scaleBy(scaleFactor, center, MGLDurationInSecondsFromTimeInterval(animated ? MGLAnimationDuration : 0)); + _mbglMap->scaleBy(scaleFactor, center, MGLDurationFromTimeInterval(animated ? MGLAnimationDuration : 0)); if ([self.delegate respondsToSelector:@selector(mapView:shouldChangeFromCamera:toCamera:)] && ![self.delegate mapView:self shouldChangeFromCamera:oldCamera toCamera:self.camera]) { self.camera = oldCamera; @@ -1118,7 +1118,7 @@ public: [self willChangeValueForKey:@"direction"]; _mbglMap->setBearing(direction, MGLEdgeInsetsFromNSEdgeInsets(self.contentInsets), - MGLDurationInSecondsFromTimeInterval(animated ? MGLAnimationDuration : 0)); + MGLDurationFromTimeInterval(animated ? MGLAnimationDuration : 0)); [self didChangeValueForKey:@"direction"]; } @@ -1146,7 +1146,7 @@ public: - (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion { mbgl::AnimationOptions animationOptions; if (duration > 0) { - animationOptions.duration.emplace(MGLDurationInSecondsFromTimeInterval(duration)); + animationOptions.duration.emplace(MGLDurationFromTimeInterval(duration)); animationOptions.easing.emplace(MGLUnitBezierForMediaTimingFunction(function)); } if (completion) { @@ -1187,7 +1187,7 @@ public: - (void)flyToCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration peakAltitude:(CLLocationDistance)peakAltitude completionHandler:(nullable void (^)(void))completion { mbgl::AnimationOptions animationOptions; if (duration >= 0) { - animationOptions.duration = MGLDurationInSecondsFromTimeInterval(duration); + animationOptions.duration = MGLDurationFromTimeInterval(duration); } if (peakAltitude >= 0) { CLLocationDegrees peakLatitude = (self.centerCoordinate.latitude + camera.centerCoordinate.latitude) / 2; @@ -1264,7 +1264,7 @@ public: mbgl::CameraOptions cameraOptions = _mbglMap->cameraForLatLngBounds(MGLLatLngBoundsFromCoordinateBounds(bounds), padding); mbgl::AnimationOptions animationOptions; if (animated) { - animationOptions.duration = MGLDurationInSecondsFromTimeInterval(MGLAnimationDuration); + animationOptions.duration = MGLDurationFromTimeInterval(MGLAnimationDuration); } MGLMapCamera *camera = [self cameraForCameraOptions:cameraOptions]; diff --git a/platform/macos/test/MGLNSDateAdditionsTests.mm b/platform/macos/test/MGLNSDateAdditionsTests.mm new file mode 100644 index 0000000000..474fe763ff --- /dev/null +++ b/platform/macos/test/MGLNSDateAdditionsTests.mm @@ -0,0 +1,26 @@ +#import + +#include +#import "../../darwin/src/NSDate+MGLAdditions.h" + +using namespace std::chrono_literals; + +@interface MGLNSDateAdditionsTests : XCTestCase +@end + +@implementation MGLNSDateAdditionsTests + +- (void)testDurationToNSTimeInterval { + + NSTimeInterval timeInterval = 5; + mbgl::Duration duration = MGLDurationFromTimeInterval(timeInterval); + NSTimeInterval durationTimeInterval = MGLTimeIntervalFromDuration(duration); + + mbgl::Duration expectedDuration = 5s; + + XCTAssertEqual(timeInterval, durationTimeInterval); + XCTAssertEqual(timeInterval, MGLTimeIntervalFromDuration(expectedDuration)); + +} + +@end -- cgit v1.2.1 From 4d058ffd94a07c1e1fe48814f29a16a1c5f8a0fd Mon Sep 17 00:00:00 2001 From: Nadia Barbosa Date: Fri, 3 Mar 2017 18:07:29 -0800 Subject: [ios, macos] Exclude MGLUserTrackingMode from macOS --- platform/darwin/src/MGLTypes.h | 15 --------------- platform/ios/src/MGLMapView.h | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'platform') diff --git a/platform/darwin/src/MGLTypes.h b/platform/darwin/src/MGLTypes.h index 8cd2cacaa6..65cebbe5f4 100644 --- a/platform/darwin/src/MGLTypes.h +++ b/platform/darwin/src/MGLTypes.h @@ -44,21 +44,6 @@ typedef NS_ENUM(NSInteger, MGLErrorCode) { MGLErrorCodeConnectionFailed = 3, }; -/** - The mode used to track the user location on the map. Used with - `MGLMapView.userTrackingMode`. - */ -typedef NS_ENUM(NSUInteger, MGLUserTrackingMode) { - /** The map does not follow the user location. */ - MGLUserTrackingModeNone = 0, - /** The map follows the user location. */ - MGLUserTrackingModeFollow, - /** The map follows the user location and rotates when the heading changes. */ - MGLUserTrackingModeFollowWithHeading, - /** The map follows the user location and rotates when the course changes. */ - MGLUserTrackingModeFollowWithCourse, -}; - /** Options for enabling debugging features in an `MGLMapView` instance. */ typedef NS_OPTIONS(NSUInteger, MGLMapDebugMaskOptions) { /** Edges of tile boundaries are shown as thick, red lines to help diagnose diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h index 4a7ac308de..bdb6d2c917 100644 --- a/platform/ios/src/MGLMapView.h +++ b/platform/ios/src/MGLMapView.h @@ -44,6 +44,21 @@ typedef NS_ENUM(NSUInteger, MGLAnnotationVerticalAlignment) { MGLAnnotationVerticalAlignmentBottom, }; +/** + The mode used to track the user location on the map. Used with + `MGLMapView.userTrackingMode`. + */ +typedef NS_ENUM(NSUInteger, MGLUserTrackingMode) { + /** The map does not follow the user location. */ + MGLUserTrackingModeNone = 0, + /** The map follows the user location. */ + MGLUserTrackingModeFollow, + /** The map follows the user location and rotates when the heading changes. */ + MGLUserTrackingModeFollowWithHeading, + /** The map follows the user location and rotates when the course changes. */ + MGLUserTrackingModeFollowWithCourse, +}; + /** An interactive, customizable map view with an interface similar to the one provided by Apple’s MapKit. -- cgit v1.2.1 From 9ea41136345c919ba06f31a940ff7a23caabfb08 Mon Sep 17 00:00:00 2001 From: Nadia Barbosa Date: Fri, 3 Mar 2017 18:09:39 -0800 Subject: [ios] Clarify docs for MGLUserTrackingMode --- platform/ios/src/MGLMapView.h | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'platform') diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h index bdb6d2c917..5d6daf74c5 100644 --- a/platform/ios/src/MGLMapView.h +++ b/platform/ios/src/MGLMapView.h @@ -51,11 +51,30 @@ typedef NS_ENUM(NSUInteger, MGLAnnotationVerticalAlignment) { typedef NS_ENUM(NSUInteger, MGLUserTrackingMode) { /** The map does not follow the user location. */ MGLUserTrackingModeNone = 0, - /** The map follows the user location. */ + /** The map follows the user location. This tracking mode falls back + to `MGLUserTrackingModeNone` if the user pans the map view. */ MGLUserTrackingModeFollow, - /** The map follows the user location and rotates when the heading changes. */ + /** + The map follows the user location and rotates when the heading changes. + The default user location annotation displays a fan-shaped indicator with + the current heading. The heading indicator represents the direction the + device is facing, which is sized according to the reported accuracy. + + This tracking mode is disabled if the user pans the map view, but + remains enabled if the user zooms in. If the user rotates the map + view, this tracking mode will fall back to `MGLUserTrackingModeFollow`. + */ MGLUserTrackingModeFollowWithHeading, - /** The map follows the user location and rotates when the course changes. */ + /** + The map follows the user location and rotates when the course changes. + Course represents the direction in which the device is traveling. + The default user location annotation shows a puck-shaped indicator + that rotates as the course changes. + + This tracking mode is disabled if the user pans the map view, but + remains enabled if the user zooms in. If the user rotates the map view, + this tracking mode will fall back to `MGLUserTrackingModeFollow`. + */ MGLUserTrackingModeFollowWithCourse, }; -- cgit v1.2.1 From 7e9701283f96bfcce3a56a3af4c8fe9154f02b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Thu, 2 Mar 2017 23:52:14 -0800 Subject: [ios, macos] Update callout when relocating annotation When relocating a selected point annotation, update the associated callout (popover) rather than deselecting the annotation. --- platform/ios/CHANGELOG.md | 3 ++- platform/ios/src/MGLMapView.mm | 13 ++----------- platform/macos/CHANGELOG.md | 3 ++- platform/macos/src/MGLMapView.mm | 11 ++--------- 4 files changed, 8 insertions(+), 22 deletions(-) (limited to 'platform') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 0579edf5f6..d4904e3252 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -2,7 +2,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. -## master +## 3.5.0 ### Packaging @@ -53,6 +53,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT ### Other changes * Fixed an issue that, among other things, caused various islands to disappear at certain zoom levels. ([#7621](https://github.com/mapbox/mapbox-gl-native/pull/7621)) +* Changing the coordinates of a point annotation no longer deselects the annotation. ([#8269](https://github.com/mapbox/mapbox-gl-native/pull/8269)) * Fixed an issue where translucent, non-view-backed point annotations along tile boundaries would be drawn darker than expected. ([#6832](https://github.com/mapbox/mapbox-gl-native/pull/6832)) * Fixed flickering that occurred when panning past the antimeridian. ([#7574](https://github.com/mapbox/mapbox-gl-native/pull/7574)) * Fixed an issue that sometimes caused crashes when the SDK interacted with the file system in the background. ([#8125](https://github.com/mapbox/mapbox-gl-native/pull/8125)) diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 401055341d..28050a879c 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1986,10 +1986,7 @@ public: // Update the annotation’s backing geometry to match the annotation model object. Any associated annotation view is also moved by side effect. However, -updateAnnotationViews disables the view’s animation actions, because it can’t distinguish between moves due to the viewport changing and moves due to the annotation’s coordinate changing. _mbglMap->updateAnnotation(annotationTag, mbgl::SymbolAnnotation { point, symbolName.UTF8String }); - if (annotationTag == _selectedAnnotationTag) - { - [self deselectAnnotation:annotation animated:YES]; - } + [self updateCalloutView]; } } else if ([keyPath isEqualToString:@"coordinates"] && [object isKindOfClass:[MGLMultiPoint class]]) @@ -2006,13 +2003,7 @@ public: { // Update the annotation’s backing geometry to match the annotation model object. _mbglMap->updateAnnotation(annotationTag, [annotation annotationObjectWithDelegate:self]); - - // We don't current support shape multipoint annotation selection, but let's make sure - // deselection is handled just to avoid problems in the future. - if (annotationTag == _selectedAnnotationTag) - { - [self deselectAnnotation:annotation animated:YES]; - } + [self updateCalloutView]; } } } diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index 7f36b36cb6..76efbc2a0d 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog for Mapbox macOS SDK -## master +## 0.4.0 ### Internationalization @@ -47,6 +47,7 @@ * Added support for the Carthage dependency manager. See [this SDK’s homepage](https://mapbox.github.io/mapbox-gl-native/macos/) for setup instructions. ([#8257](https://github.com/mapbox/mapbox-gl-native/pull/8257)) * Fixed an issue that, among other things, caused various islands to disappear at certain zoom levels. ([#7621](https://github.com/mapbox/mapbox-gl-native/pull/7621)) +* Changing the coordinates of a point annotation no longer deselects the annotation. ([#8269](https://github.com/mapbox/mapbox-gl-native/pull/8269)) * Fixed an issue where translucent point annotations along tile boundaries would be drawn darker than expected. ([#6832](https://github.com/mapbox/mapbox-gl-native/pull/6832)) * Fixed flickering that occurred when panning past the antimeridian. ([#7574](https://github.com/mapbox/mapbox-gl-native/pull/7574)) * Added a `MGLDistanceFormatter` class for formatting geographic distances. ([#7888](https://github.com/mapbox/mapbox-gl-native/pull/7888)) diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index d70b5c0f03..3e76fa9ad0 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -538,9 +538,7 @@ public: const mbgl::Point point = MGLPointFromLocationCoordinate2D(annotation.coordinate); MGLAnnotationImage *annotationImage = [self imageOfAnnotationWithTag:annotationTag]; _mbglMap->updateAnnotation(annotationTag, mbgl::SymbolAnnotation { point, annotationImage.styleIconIdentifier.UTF8String ?: "" }); - if (annotationTag == _selectedAnnotationTag) { - [self deselectAnnotation:annotation]; - } + [self updateAnnotationCallouts]; } } else if ([keyPath isEqualToString:@"coordinates"] && [object isKindOfClass:[MGLMultiPoint class]]) { @@ -554,12 +552,7 @@ public: // but safely updated. if (annotation == [self annotationWithTag:annotationTag]) { _mbglMap->updateAnnotation(annotationTag, [annotation annotationObjectWithDelegate:self]); - // We don't current support shape multipoint annotation selection, but let's make sure - // deselection is handled just to avoid problems in the future. - if (annotationTag == _selectedAnnotationTag) - { - [self deselectAnnotation:annotation]; - } + [self updateAnnotationCallouts]; } } } -- cgit v1.2.1 From 5e36743ef76dc590be45dddf376139c35ea145a4 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Fri, 3 Mar 2017 13:27:28 -0800 Subject: [ios] Add SDK version update checking/notification --- platform/ios/CHANGELOG.md | 1 + platform/ios/ios.xcodeproj/project.pbxproj | 12 +++++++ .../ios/resources/Base.lproj/Localizable.strings | 3 ++ .../ios/resources/ja.lproj/Localizable.strings | 3 ++ platform/ios/src/MGLMapView.mm | 9 +++++ platform/ios/src/MGLSDKUpdateChecker.h | 13 ++++++++ platform/ios/src/MGLSDKUpdateChecker.mm | 39 ++++++++++++++++++++++ 7 files changed, 80 insertions(+) create mode 100644 platform/ios/src/MGLSDKUpdateChecker.h create mode 100644 platform/ios/src/MGLSDKUpdateChecker.mm (limited to 'platform') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index d4904e3252..8e18b353f9 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 * The minimum deployment target for this SDK is now iOS 8. ([#8129](https://github.com/mapbox/mapbox-gl-native/pull/8129)) * Added support for the Carthage dependency manager. See [our website](https://www.mapbox.com/ios-sdk/) for setup instructions. ([#8257](https://github.com/mapbox/mapbox-gl-native/pull/8257)) +* Added a simulator-only console notification to inform developers if there is a newer version of this SDK available. ([#8282](https://github.com/mapbox/mapbox-gl-native/pull/8282)) ### Internationalization diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index 41cb092e27..3256e304af 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -187,6 +187,10 @@ 7E016D851D9E890300A29A21 /* MGLPolygon+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E016D821D9E890300A29A21 /* MGLPolygon+MGLAdditions.h */; }; 7E016D861D9E890300A29A21 /* MGLPolygon+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E016D831D9E890300A29A21 /* MGLPolygon+MGLAdditions.m */; }; 7E016D871D9E890300A29A21 /* MGLPolygon+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E016D831D9E890300A29A21 /* MGLPolygon+MGLAdditions.m */; }; + 9620BB381E69FE1700705A1D /* MGLSDKUpdateChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 9620BB361E69FE1700705A1D /* MGLSDKUpdateChecker.h */; }; + 9620BB391E69FE1700705A1D /* MGLSDKUpdateChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 9620BB361E69FE1700705A1D /* MGLSDKUpdateChecker.h */; }; + 9620BB3A1E69FE1700705A1D /* MGLSDKUpdateChecker.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9620BB371E69FE1700705A1D /* MGLSDKUpdateChecker.mm */; }; + 9620BB3B1E69FE1700705A1D /* MGLSDKUpdateChecker.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9620BB371E69FE1700705A1D /* MGLSDKUpdateChecker.mm */; }; 968F36B51E4D128D003A5522 /* MGLDistanceFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3557F7AE1E1D27D300CCA5E6 /* MGLDistanceFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; 96E027231E57C76E004B8E66 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 96E027251E57C76E004B8E66 /* Localizable.strings */; }; DA00FC8E1D5EEB0D009AABC8 /* MGLAttributionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = DA00FC8C1D5EEB0D009AABC8 /* MGLAttributionInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -642,6 +646,8 @@ 7E016D7D1D9E86BE00A29A21 /* MGLPolyline+MGLAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MGLPolyline+MGLAdditions.m"; sourceTree = ""; }; 7E016D821D9E890300A29A21 /* MGLPolygon+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MGLPolygon+MGLAdditions.h"; sourceTree = ""; }; 7E016D831D9E890300A29A21 /* MGLPolygon+MGLAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MGLPolygon+MGLAdditions.m"; sourceTree = ""; }; + 9620BB361E69FE1700705A1D /* MGLSDKUpdateChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLSDKUpdateChecker.h; sourceTree = ""; }; + 9620BB371E69FE1700705A1D /* MGLSDKUpdateChecker.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = MGLSDKUpdateChecker.mm; sourceTree = ""; }; 9660916B1E5BBFD700A9A03B /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = ""; }; 9660916C1E5BBFD900A9A03B /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = ""; }; 9660916D1E5BBFDB00A9A03B /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = ""; }; @@ -1523,6 +1529,8 @@ DA8848471CBAFB9800AB86E3 /* MGLLocationManager.m */, DA8848481CBAFB9800AB86E3 /* MGLMapboxEvents.h */, DA8848491CBAFB9800AB86E3 /* MGLMapboxEvents.m */, + 9620BB361E69FE1700705A1D /* MGLSDKUpdateChecker.h */, + 9620BB371E69FE1700705A1D /* MGLSDKUpdateChecker.mm */, ); name = Telemetry; sourceTree = ""; @@ -1618,6 +1626,7 @@ 30E578171DAA85520050F07E /* UIImage+MGLAdditions.h in Headers */, DAD1656C1CF41981001FF4B9 /* MGLFeature.h in Headers */, 40EDA1C01CFE0E0200D9EA68 /* MGLAnnotationContainerView.h in Headers */, + 9620BB381E69FE1700705A1D /* MGLSDKUpdateChecker.h in Headers */, DA88484F1CBAFB9800AB86E3 /* MGLAnnotationImage_Private.h in Headers */, 1753ED421E53CE6F00A9FD90 /* MGLConversion.h in Headers */, DA8847F21CBAFA5100AB86E3 /* MGLMapCamera.h in Headers */, @@ -1679,6 +1688,7 @@ DA17BE311CC4BDAA00402C41 /* MGLMapView_Private.h in Headers */, DABFB86C1CBE99E500D62B32 /* MGLTypes.h in Headers */, DABFB8691CBE99E500D62B32 /* MGLShape.h in Headers */, + 9620BB391E69FE1700705A1D /* MGLSDKUpdateChecker.h in Headers */, 3510FFEB1D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.h in Headers */, 35E1A4D91D74336F007AA97F /* MGLValueEvaluator.h in Headers */, 7E016D7F1D9E86BE00A29A21 /* MGLPolyline+MGLAdditions.h in Headers */, @@ -2095,6 +2105,7 @@ 3510FFEC1D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.mm in Sources */, 7E016D801D9E86BE00A29A21 /* MGLPolyline+MGLAdditions.m in Sources */, DAED38651D62D0FC00D7640F /* NSURL+MGLAdditions.m in Sources */, + 9620BB3A1E69FE1700705A1D /* MGLSDKUpdateChecker.mm in Sources */, 354B83981D2E873E005D9406 /* MGLUserLocationAnnotationView.m in Sources */, DA88485D1CBAFB9800AB86E3 /* MGLFaux3DUserLocationAnnotationView.m in Sources */, DAD165701CF41981001FF4B9 /* MGLFeature.mm in Sources */, @@ -2172,6 +2183,7 @@ 3510FFED1D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.mm in Sources */, 7E016D811D9E86BE00A29A21 /* MGLPolyline+MGLAdditions.m in Sources */, 354B83991D2E873E005D9406 /* MGLUserLocationAnnotationView.m in Sources */, + 9620BB3B1E69FE1700705A1D /* MGLSDKUpdateChecker.mm in Sources */, DAA4E4221CBB730400178DFB /* MGLPointAnnotation.mm in Sources */, DAED38661D62D0FC00D7640F /* NSURL+MGLAdditions.m in Sources */, DAD165711CF41981001FF4B9 /* MGLFeature.mm in Sources */, diff --git a/platform/ios/resources/Base.lproj/Localizable.strings b/platform/ios/resources/Base.lproj/Localizable.strings index 63bed7e326..ab071a4505 100644 --- a/platform/ios/resources/Base.lproj/Localizable.strings +++ b/platform/ios/resources/Base.lproj/Localizable.strings @@ -43,6 +43,9 @@ /* Action sheet title */ "SDK_NAME" = "Mapbox iOS SDK"; +/* Developer-only SDK update notification; {latest version, in format x.x.x} */ +"SDK_UPDATE_AVAILABLE" = "Mapbox iOS SDK version %@ is now available:"; + /* Telemetry prompt message */ "TELEMETRY_DISABLED_MSG" = "You can help make OpenStreetMap and Mapbox maps better by contributing anonymous usage data."; diff --git a/platform/ios/resources/ja.lproj/Localizable.strings b/platform/ios/resources/ja.lproj/Localizable.strings index 87c40bb920..b8fde1cdb2 100644 --- a/platform/ios/resources/ja.lproj/Localizable.strings +++ b/platform/ios/resources/ja.lproj/Localizable.strings @@ -43,6 +43,9 @@ /* Action sheet title */ "SDK_NAME" = "Mapbox iOS SDK"; +/* Developer-only SDK update notification; {latest version, in format x.x.x} */ +"SDK_UPDATE_AVAILABLE" = "現在Mapbox iOS SDK %1$@が入手できる:"; + /* Telemetry prompt message */ "TELEMETRY_DISABLED_MSG" = "You can help make OpenStreetMap and Mapbox maps better by contributing anonymous usage data."; diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 28050a879c..35c6a3d0e8 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -55,6 +55,7 @@ #import "MGLStyle_Private.h" #import "MGLStyleLayer_Private.h" #import "MGLMapboxEvents.h" +#import "MGLSDKUpdateChecker.h" #import "MGLCompactCalloutView.h" #import "MGLAnnotationContainerView.h" #import "MGLAnnotationContainerView_Private.h" @@ -347,6 +348,14 @@ public: return self; } ++ (void)initialize +{ + if (self == [MGLMapView self]) + { + [MGLSDKUpdateChecker checkForUpdates]; + } +} + + (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingStyle { return [NSSet setWithObject:@"styleURL"]; diff --git a/platform/ios/src/MGLSDKUpdateChecker.h b/platform/ios/src/MGLSDKUpdateChecker.h new file mode 100644 index 0000000000..13cef46ad4 --- /dev/null +++ b/platform/ios/src/MGLSDKUpdateChecker.h @@ -0,0 +1,13 @@ +#import + +#import "MGLFoundation.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface MGLSDKUpdateChecker : NSObject + ++ (void)checkForUpdates; + +@end + +NS_ASSUME_NONNULL_END diff --git a/platform/ios/src/MGLSDKUpdateChecker.mm b/platform/ios/src/MGLSDKUpdateChecker.mm new file mode 100644 index 0000000000..a342a68c0d --- /dev/null +++ b/platform/ios/src/MGLSDKUpdateChecker.mm @@ -0,0 +1,39 @@ +#import "MGLSDKUpdateChecker.h" +#import "NSBundle+MGLAdditions.h" +#import "NSProcessInfo+MGLAdditions.h" + +@implementation MGLSDKUpdateChecker + ++ (void)checkForUpdates { +#if TARGET_IPHONE_SIMULATOR + // Abort if running in a playground. + if ([[NSBundle mainBundle].bundleIdentifier hasPrefix:@"com.apple.dt.playground."] || + NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent) { + return; + } + + NSString *currentVersion = [NSBundle mgl_frameworkInfoDictionary][@"MGLSemanticVersionString"]; + + // Skip version check if weʼre doing gl-native development, as the framework + // version is `1` until built for packaging. + if ([currentVersion isEqualToString:@"1.0.0"]) { + return; + } + + NSURL *url = [NSURL URLWithString:@"https://mapbox.s3.amazonaws.com/mapbox-gl-native/ios/latest_version"]; + [[NSURLSession.sharedSession dataTaskWithURL:url completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { + if (error || ((NSHTTPURLResponse *)response).statusCode != 200) { + return; + } + + NSString *latestVersion = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + latestVersion = [latestVersion stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + if (![currentVersion isEqualToString:latestVersion]) { + NSString *updateAvailable = [NSString stringWithFormat:NSLocalizedStringWithDefaultValue(@"SDK_UPDATE_AVAILABLE", nil, nil, @"Mapbox iOS SDK version %@ is now available:", @"Developer-only SDK update notification; {latest version, in format x.x.x}"), latestVersion]; + NSLog(@"%@ https://github.com/mapbox/mapbox-gl-native/releases/tag/ios-v%@", updateAvailable, latestVersion); + } + }] resume]; +#endif +} + +@end -- cgit v1.2.1 From a6bbf09fa6a05dab63102fbdfab310fb71cd113d Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Sat, 4 Mar 2017 19:18:51 -0800 Subject: [ios] Add version checker update to deploy script --- platform/ios/scripts/deploy-packages.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'platform') diff --git a/platform/ios/scripts/deploy-packages.sh b/platform/ios/scripts/deploy-packages.sh index 4a3c73295a..c9887de065 100755 --- a/platform/ios/scripts/deploy-packages.sh +++ b/platform/ios/scripts/deploy-packages.sh @@ -47,6 +47,24 @@ buildPackageStyle() { fi } +bumpVersionForUpdateChecker() { + if [[ $( echo ${PUBLISH_VERSION} | awk '/[0-9]-/' ) ]]; then + step "Skipping version checker bump because this is a pre-release" + return + fi + + step "Updating version checker to ${PUBLISH_VERSION}…" + + CHECKER_FILENAME="latest_version" + CHECKER_PATH=${BINARY_DIRECTORY}/${CHECKER_FILENAME} + + echo ${PUBLISH_VERSION} > ${CHECKER_PATH} + aws s3 cp ${CHECKER_PATH} s3://mapbox/${GITHUB_REPO}/ios/${CHECKER_FILENAME} --acl public-read --content-type text/plain + + verification=$( curl -L http://mapbox.s3.amazonaws.com/${GITHUB_REPO}/ios/${CHECKER_FILENAME} ) + echo "Updated version checker to ${verification}" +} + export TRAVIS_REPO_SLUG=mapbox-gl-native export GITHUB_USER=mapbox export GITHUB_REPO=mapbox-gl-native @@ -114,4 +132,6 @@ buildPackageStyle "iframework" "symbols-dynamic" buildPackageStyle "iframework SYMBOLS=NO" "dynamic" buildPackageStyle "ifabric" "fabric" +bumpVersionForUpdateChecker + step "Finished deploying ${PUBLISH_VERSION} in $(($SECONDS / 60)) minutes and $(($SECONDS % 60)) seconds" -- cgit v1.2.1 From ece19acd10a09922a3106872c720b00089bf4b5b Mon Sep 17 00:00:00 2001 From: Jordan Kiley Date: Tue, 7 Mar 2017 17:39:42 -0800 Subject: [ios, macos] Added a timing note for two delegate methods (#8259) --- platform/ios/src/MGLMapViewDelegate.h | 20 +++++++++++--------- platform/macos/src/MGLMapViewDelegate.h | 14 +++++++++----- 2 files changed, 20 insertions(+), 14 deletions(-) (limited to 'platform') diff --git a/platform/ios/src/MGLMapViewDelegate.h b/platform/ios/src/MGLMapViewDelegate.h index 12320a63a5..c1faaa3d07 100644 --- a/platform/ios/src/MGLMapViewDelegate.h +++ b/platform/ios/src/MGLMapViewDelegate.h @@ -22,12 +22,11 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark Responding to Map Position Changes /** - Tells the delegate that the viewpoint depicted by the map view is about to - change. - + Tells the delegate that the viewpoint depicted by the map view is about to change. + This method is called whenever the currently displayed map camera will start changing for any reason. - + @param mapView The map view whose viewpoint will change. @param animated Whether the change will cause an animated effect on the map. */ @@ -38,10 +37,12 @@ NS_ASSUME_NONNULL_BEGIN This method is called as the currently displayed map camera changes as part of an animation, whether due to a user gesture or due to a call to a method such - as `-[MGLMapView setCamera:animated:]`. During the animation, this method may - be called many times to report updates to the viewpoint. Therefore, your - implementation of this method should be as lightweight as possible to avoid - affecting performance. + as `-[MGLMapView setCamera:animated:]`. This method can be called before + `-mapViewDidFinishLoadingMap:` is called. + + During the animation, this method may be called many times to report updates to + the viewpoint. Therefore, your implementation of this method should be as lightweight + as possible to avoid affecting performance. @param mapView The map view whose viewpoint is changing. */ @@ -52,7 +53,8 @@ NS_ASSUME_NONNULL_BEGIN changing. This method is called whenever the currently displayed map camera has finished - changing, after any calls to `-mapViewRegionIsChanging:` due to animation. + changing, after any calls to `-mapViewRegionIsChanging:` due to animation. Therefore, + this method can be called before `-mapViewDidFinishLoadingMap:` is called. @param mapView The map view whose viewpoint has changed. @param animated Whether the change caused an animated effect on the map. diff --git a/platform/macos/src/MGLMapViewDelegate.h b/platform/macos/src/MGLMapViewDelegate.h index 08a9f7eff4..dae5b40286 100644 --- a/platform/macos/src/MGLMapViewDelegate.h +++ b/platform/macos/src/MGLMapViewDelegate.h @@ -40,10 +40,12 @@ NS_ASSUME_NONNULL_BEGIN This method is called as the currently displayed map camera changes as part of an animation, whether due to a user gesture or due to a call to a method such - as `-[MGLMapView setCamera:animated:]`. During the animation, this method may - be called many times to report updates to the viewpoint. Therefore, your - implementation of this method should be as lightweight as possible to avoid - affecting performance. + as `-[MGLMapView setCamera:animated:]`. This method can be called before + `-mapViewDidFinishLoadingMap:` is called. + + During the animation, this method may be called many times to report updates + to the viewpoint. Therefore, your implementation of this method should be as + lightweight as possible to avoid affecting performance. @param mapView The map view whose viewpoint is changing. */ @@ -55,7 +57,9 @@ NS_ASSUME_NONNULL_BEGIN This method is called whenever the currently displayed map camera has finished changing, after any calls to `-mapViewRegionIsChanging:` due to animation. - + This method can be called before `-mapViewDidFinishLoadingMap:` is + called. + @param mapView The map view whose viewpoint has changed. @param animated Whether the change caused an animated effect on the map. */ -- cgit v1.2.1 From 85f0eeff343933e93c74a12b13c31e6f3658e0a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Wed, 8 Mar 2017 02:43:33 -0800 Subject: [ios, macos] Russian, Catalan, Lithuanian, Finnish, Dutch (#8256) * [ios, macos] Updated Russian translations * [ios, macos] Added Catalan translation * [ios, macos] Completed Lithuanian translation * [ios, macos] Added Finnish translation * [ios, macos] Fixed Polish, Ukrainian declension * [ios, macos] Updated changelogs * [ios, macos] Added Dutch localization --- .../darwin/resources/ca.lproj/Foundation.strings | 291 +++++++++++++++++++++ .../resources/ca.lproj/Foundation.stringsdict | 54 ++++ .../darwin/resources/lt.lproj/Foundation.strings | 291 +++++++++++++++++++++ .../resources/lt.lproj/Foundation.stringsdict | 66 +++++ .../resources/pl.lproj/Foundation.stringsdict | 6 + .../resources/ru.lproj/Foundation.stringsdict | 6 + .../resources/uk.lproj/Foundation.stringsdict | 12 +- platform/ios/CHANGELOG.md | 4 +- platform/ios/app/ca.lproj/Localizable.strings | 0 platform/ios/app/fi.lproj/Localizable.strings | 0 platform/ios/app/nl.lproj/Localizable.strings | 0 .../Settings.bundle/ca.lproj/Root.strings | 3 + .../Settings.bundle/fi.lproj/Root.strings | 3 + .../Settings.bundle/nl.lproj/Root.strings | 3 + platform/ios/ios.xcodeproj/project.pbxproj | 31 ++- .../ios/resources/ca.lproj/Localizable.strings | 75 ++++++ .../ios/resources/ca.lproj/Localizable.stringsdict | 23 ++ .../ios/resources/ru.lproj/Localizable.strings | 8 +- .../ios/resources/ru.lproj/Localizable.stringsdict | 27 ++ platform/macos/CHANGELOG.md | 4 +- platform/macos/app/ca.lproj/Localizable.strings | 0 platform/macos/app/fi.lproj/Localizable.strings | 0 platform/macos/app/nl.lproj/Localizable.strings | 0 platform/macos/app/ru.lproj/Localizable.strings | 0 platform/macos/macos.xcodeproj/project.pbxproj | 30 +++ platform/macos/sdk/ca.lproj/Localizable.strings | 15 ++ platform/macos/sdk/fi.lproj/Localizable.strings | 15 ++ platform/macos/sdk/nl.lproj/Localizable.strings | 15 ++ platform/macos/sdk/ru.lproj/Localizable.strings | 15 ++ 29 files changed, 985 insertions(+), 12 deletions(-) create mode 100644 platform/darwin/resources/ca.lproj/Foundation.strings create mode 100644 platform/darwin/resources/ca.lproj/Foundation.stringsdict create mode 100644 platform/darwin/resources/lt.lproj/Foundation.strings create mode 100644 platform/darwin/resources/lt.lproj/Foundation.stringsdict create mode 100644 platform/ios/app/ca.lproj/Localizable.strings create mode 100644 platform/ios/app/fi.lproj/Localizable.strings create mode 100644 platform/ios/app/nl.lproj/Localizable.strings create mode 100644 platform/ios/framework/Settings.bundle/ca.lproj/Root.strings create mode 100644 platform/ios/framework/Settings.bundle/fi.lproj/Root.strings create mode 100644 platform/ios/framework/Settings.bundle/nl.lproj/Root.strings create mode 100644 platform/ios/resources/ca.lproj/Localizable.strings create mode 100644 platform/ios/resources/ca.lproj/Localizable.stringsdict create mode 100644 platform/ios/resources/ru.lproj/Localizable.stringsdict create mode 100644 platform/macos/app/ca.lproj/Localizable.strings create mode 100644 platform/macos/app/fi.lproj/Localizable.strings create mode 100644 platform/macos/app/nl.lproj/Localizable.strings create mode 100644 platform/macos/app/ru.lproj/Localizable.strings create mode 100644 platform/macos/sdk/ca.lproj/Localizable.strings create mode 100644 platform/macos/sdk/fi.lproj/Localizable.strings create mode 100644 platform/macos/sdk/nl.lproj/Localizable.strings create mode 100644 platform/macos/sdk/ru.lproj/Localizable.strings (limited to 'platform') diff --git a/platform/darwin/resources/ca.lproj/Foundation.strings b/platform/darwin/resources/ca.lproj/Foundation.strings new file mode 100644 index 0000000000..e36ea9ed8a --- /dev/null +++ b/platform/darwin/resources/ca.lproj/Foundation.strings @@ -0,0 +1,291 @@ +/* Clock position format, long: {hours} o’clock */ +"CLOCK_FMT_LONG" = "%@ en punt"; + +/* Clock position format, medium: {hours} o’clock */ +"CLOCK_FMT_MEDIUM" = "%@ en punt"; + +/* Clock position format, short: {hours}:00 */ +"CLOCK_FMT_SHORT" = "%@:00"; + +/* East, long */ +"COMPASS_E_LONG" = "est"; + +/* East, short */ +"COMPASS_E_SHORT" = "E"; + +/* East by north, long */ +"COMPASS_EbN_LONG" = "est per nord"; + +/* East by north, short */ +"COMPASS_EbN_SHORT" = "EpN"; + +/* East by south, long */ +"COMPASS_EbS_LONG" = "est per sud"; + +/* East by south, short */ +"COMPASS_EbS_SHORT" = "EpS"; + +/* East-northeast, long */ +"COMPASS_ENE_LONG" = "est-nord-est"; + +/* East-northeast, short */ +"COMPASS_ENE_SHORT" = "ENE"; + +/* East-southeast, long */ +"COMPASS_ESE_LONG" = "est-sud-est"; + +/* East-southeast, short */ +"COMPASS_ESE_SHORT" = "ESE"; + +/* North, long */ +"COMPASS_N_LONG" = "nord"; + +/* North, short */ +"COMPASS_N_SHORT" = "N"; + +/* North by east, long */ +"COMPASS_NbE_LONG" = "nord per est"; + +/* North by east, short */ +"COMPASS_NbE_SHORT" = "NpE"; + +/* North by west, long */ +"COMPASS_NbW_LONG" = "nord per oest"; + +/* North by west, short */ +"COMPASS_NbW_SHORT" = "NpO"; + +/* Northeast, long */ +"COMPASS_NE_LONG" = "nord-est"; + +/* Northeast, short */ +"COMPASS_NE_SHORT" = "NE"; + +/* Northeast by east, long */ +"COMPASS_NEbE_LONG" = "nord-est per est"; + +/* Northeast by east, short */ +"COMPASS_NEbE_SHORT" = "NEpE"; + +/* Northeast by north, long */ +"COMPASS_NEbN_LONG" = "nord-est per nord"; + +/* Northeast by north, short */ +"COMPASS_NEbN_SHORT" = "NEpN"; + +/* North-northeast, long */ +"COMPASS_NNE_LONG" = "nord-nord-est"; + +/* North-northeast, short */ +"COMPASS_NNE_SHORT" = "NNE"; + +/* North-northwest, long */ +"COMPASS_NNW_LONG" = "nord-nord-oest"; + +/* North-northwest, short */ +"COMPASS_NNW_SHORT" = "NNO"; + +/* Northwest, long */ +"COMPASS_NW_LONG" = "nord-oest"; + +/* Northwest, short */ +"COMPASS_NW_SHORT" = "NO"; + +/* Northwest by north, long */ +"COMPASS_NWbN_LONG" = "nord-oest per nord"; + +/* Northwest by north, short */ +"COMPASS_NWbN_SHORT" = "NOpN"; + +/* Northwest by west, long */ +"COMPASS_NWbW_LONG" = "nord-oest per oest"; + +/* Northwest by west, short */ +"COMPASS_NWbW_SHORT" = "NOpO"; + +/* South, long */ +"COMPASS_S_LONG" = "sud"; + +/* South, short */ +"COMPASS_S_SHORT" = "S"; + +/* South by east, long */ +"COMPASS_SbE_LONG" = "sud per est"; + +/* South by east, short */ +"COMPASS_SbE_SHORT" = "SpE"; + +/* South by west, long */ +"COMPASS_SbW_LONG" = "sud per oest"; + +/* South by west, short */ +"COMPASS_SbW_SHORT" = "SpO"; + +/* Southeast, long */ +"COMPASS_SE_LONG" = "sud-est"; + +/* Southeast, short */ +"COMPASS_SE_SHORT" = "SE"; + +/* Southeast by east, long */ +"COMPASS_SEbE_LONG" = "sud-est per est"; + +/* Southeast by east, short */ +"COMPASS_SEbE_SHORT" = "SEpE"; + +/* Southeast by south, long */ +"COMPASS_SEbS_LONG" = "sud-est per sud"; + +/* Southeast by south, short */ +"COMPASS_SEbS_SHORT" = "SEpS"; + +/* South-southeast, long */ +"COMPASS_SSE_LONG" = "sud-sud-est"; + +/* South-southeast, short */ +"COMPASS_SSE_SHORT" = "SSE"; + +/* South-southwest, long */ +"COMPASS_SSW_LONG" = "sud-sud-oest"; + +/* South-southwest, short */ +"COMPASS_SSW_SHORT" = "SSO"; + +/* Southwest, long */ +"COMPASS_SW_LONG" = "sud-oest"; + +/* Southwest, short */ +"COMPASS_SW_SHORT" = "SO"; + +/* Southwest by south, long */ +"COMPASS_SWbS_LONG" = "sud-oest per sud"; + +/* Southwest by south, short */ +"COMPASS_SWbS_SHORT" = "SOpS"; + +/* Southwest by west, long */ +"COMPASS_SWbW_LONG" = "sud-oest per oest"; + +/* Southwest by west, short */ +"COMPASS_SWbW_SHORT" = "SOpO"; + +/* West, long */ +"COMPASS_W_LONG" = "oest"; + +/* West, short */ +"COMPASS_W_SHORT" = "O"; + +/* West by north, long */ +"COMPASS_WbN_LONG" = "oest per nord"; + +/* West by north, short */ +"COMPASS_WbN_SHORT" = "OpN"; + +/* West by south, long */ +"COMPASS_WbS_LONG" = "oest per sud"; + +/* West by south, short */ +"COMPASS_WbS_SHORT" = "OpS"; + +/* West-northwest, long */ +"COMPASS_WNW_LONG" = "oest-nord-oest"; + +/* West-northwest, short */ +"COMPASS_WNW_SHORT" = "ONO"; + +/* West-southwest, long */ +"COMPASS_WSW_LONG" = "oest-sud-oest"; + +/* West-southwest, short */ +"COMPASS_WSW_SHORT" = "OSO"; + +/* Degrees format, long */ +"COORD_DEG_LONG" = "%d grau(s)"; + +/* Degrees format, medium: {degrees} */ +"COORD_DEG_MEDIUM" = "%d°"; + +/* Degrees format, short: {degrees} */ +"COORD_DEG_SHORT" = "%d°"; + +/* Coordinate format, long: {degrees}{minutes} */ +"COORD_DM_LONG" = "%1$@ i %2$@"; + +/* Coordinate format, medium: {degrees}{minutes} */ +"COORD_DM_MEDIUM" = "%1$@%2$@"; + +/* Coordinate format, short: {degrees}{minutes} */ +"COORD_DM_SHORT" = "%1$@%2$@"; + +/* Coordinate format, long: {degrees}{minutes}{seconds} */ +"COORD_DMS_LONG" = "%1$@, %2$@, i %3$@"; + +/* Coordinate format, medium: {degrees}{minutes}{seconds} */ +"COORD_DMS_MEDIUM" = "%1$@%2$@%3$@"; + +/* Coordinate format, short: {degrees}{minutes}{seconds} */ +"COORD_DMS_SHORT" = "%1$@%2$@%3$@"; + +/* East longitude format, long: {longitude} */ +"COORD_E_LONG" = "%@ est"; + +/* East longitude format, medium: {longitude} */ +"COORD_E_MEDIUM" = "%@ est"; + +/* East longitude format, short: {longitude} */ +"COORD_E_SHORT" = "%@E"; + +/* Coordinate pair format, long: {latitude}, {longitude} */ +"COORD_FMT_LONG" = "%1$@ per %2$@"; + +/* Coordinate pair format, medium: {latitude}, {longitude} */ +"COORD_FMT_MEDIUM" = "%1$@, %2$@"; + +/* Coordinate pair format, short: {latitude}, {longitude} */ +"COORD_FMT_SHORT" = "%1$@, %2$@"; + +/* Minutes format, long */ +"COORD_MIN_LONG" = "%d minut(s)"; + +/* Minutes format, medium: {minutes} */ +"COORD_MIN_MEDIUM" = "%d′"; + +/* Minutes format, short: {minutes} */ +"COORD_MIN_SHORT" = "%d′"; + +/* North latitude format, long: {latitude} */ +"COORD_N_LONG" = "%@ nord"; + +/* North latitude format, medium: {latitude} */ +"COORD_N_MEDIUM" = "%@ nord"; + +/* North latitude format, short: {latitude} */ +"COORD_N_SHORT" = "%@N"; + +/* South latitude format, long: {latitude} */ +"COORD_S_LONG" = "%@ sud"; + +/* South latitude format, medium: {latitude} */ +"COORD_S_MEDIUM" = "%@ sud"; + +/* South latitude format, short: {latitude} */ +"COORD_S_SHORT" = "%@S"; + +/* Seconds format, long */ +"COORD_SEC_LONG" = "%d segon(s)"; + +/* Seconds format, medium: {seconds} */ +"COORD_SEC_MEDIUM" = "%d″"; + +/* Seconds format, short: {seconds} */ +"COORD_SEC_SHORT" = "%d″"; + +/* West longitude format, long: {longitude} */ +"COORD_W_LONG" = "%@ oest"; + +/* West longitude format, medium: {longitude} */ +"COORD_W_MEDIUM" = "%@ oest"; + +/* West longitude format, short: {longitude} */ +"COORD_W_SHORT" = "%@O"; + diff --git a/platform/darwin/resources/ca.lproj/Foundation.stringsdict b/platform/darwin/resources/ca.lproj/Foundation.stringsdict new file mode 100644 index 0000000000..8bacec946f --- /dev/null +++ b/platform/darwin/resources/ca.lproj/Foundation.stringsdict @@ -0,0 +1,54 @@ + + + + + COORD_DEG_LONG + + NSStringLocalizedFormatKey + %#@degrees@ + degrees + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + one + %d grau + other + %d graus + + + COORD_MIN_LONG + + NSStringLocalizedFormatKey + %#@minutes@ + minutes + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + one + %d minut + other + %d minuts + + + COORD_SEC_LONG + + NSStringLocalizedFormatKey + %#@seconds@ + seconds + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + one + %d segon + other + %d segons + + + + diff --git a/platform/darwin/resources/lt.lproj/Foundation.strings b/platform/darwin/resources/lt.lproj/Foundation.strings new file mode 100644 index 0000000000..68e7e14bda --- /dev/null +++ b/platform/darwin/resources/lt.lproj/Foundation.strings @@ -0,0 +1,291 @@ +/* Clock position format, long: {hours} o’clock */ +"CLOCK_FMT_LONG" = "Laikas: %@"; + +/* Clock position format, medium: {hours} o’clock */ +"CLOCK_FMT_MEDIUM" = "Laikas: %@"; + +/* Clock position format, short: {hours}:00 */ +"CLOCK_FMT_SHORT" = "%@:00"; + +/* East, long */ +"COMPASS_E_LONG" = "rytai"; + +/* East, short */ +"COMPASS_E_SHORT" = "R"; + +/* East by north, long */ +"COMPASS_EbN_LONG" = "rytai į šiaurę"; + +/* East by north, short */ +"COMPASS_EbN_SHORT" = "RįŠ"; + +/* East by south, long */ +"COMPASS_EbS_LONG" = "rytai į pietus"; + +/* East by south, short */ +"COMPASS_EbS_SHORT" = "RįP"; + +/* East-northeast, long */ +"COMPASS_ENE_LONG" = "rytai - šiaurės rytai"; + +/* East-northeast, short */ +"COMPASS_ENE_SHORT" = "R-ŠR"; + +/* East-southeast, long */ +"COMPASS_ESE_LONG" = "rytai - pietryčiai"; + +/* East-southeast, short */ +"COMPASS_ESE_SHORT" = "R-PR"; + +/* North, long */ +"COMPASS_N_LONG" = "šiaurė"; + +/* North, short */ +"COMPASS_N_SHORT" = "Š"; + +/* North by east, long */ +"COMPASS_NbE_LONG" = "šiaurė į rytus"; + +/* North by east, short */ +"COMPASS_NbE_SHORT" = "ŠįR"; + +/* North by west, long */ +"COMPASS_NbW_LONG" = "šiaurė į vakarus"; + +/* North by west, short */ +"COMPASS_NbW_SHORT" = "ŠįV"; + +/* Northeast, long */ +"COMPASS_NE_LONG" = "šiaurės rytai"; + +/* Northeast, short */ +"COMPASS_NE_SHORT" = "ŠR"; + +/* Northeast by east, long */ +"COMPASS_NEbE_LONG" = "šiaurės rytai į rytus"; + +/* Northeast by east, short */ +"COMPASS_NEbE_SHORT" = "ŠRįR"; + +/* Northeast by north, long */ +"COMPASS_NEbN_LONG" = "šiaurės rytai į šiaurę"; + +/* Northeast by north, short */ +"COMPASS_NEbN_SHORT" = "ŠRįŠ"; + +/* North-northeast, long */ +"COMPASS_NNE_LONG" = "šiaurė - šiaurės rytai"; + +/* North-northeast, short */ +"COMPASS_NNE_SHORT" = "ŠŠR"; + +/* North-northwest, long */ +"COMPASS_NNW_LONG" = "šiaurė - šiaurės vakarai"; + +/* North-northwest, short */ +"COMPASS_NNW_SHORT" = "ŠŠV"; + +/* Northwest, long */ +"COMPASS_NW_LONG" = "šiaurės vakarai"; + +/* Northwest, short */ +"COMPASS_NW_SHORT" = "ŠV"; + +/* Northwest by north, long */ +"COMPASS_NWbN_LONG" = "šiaurės vakarai į šiaurę"; + +/* Northwest by north, short */ +"COMPASS_NWbN_SHORT" = "ŠVįŠ"; + +/* Northwest by west, long */ +"COMPASS_NWbW_LONG" = "šiaurės vakarai į vakarus"; + +/* Northwest by west, short */ +"COMPASS_NWbW_SHORT" = "ŠVįV"; + +/* South, long */ +"COMPASS_S_LONG" = "pietūs"; + +/* South, short */ +"COMPASS_S_SHORT" = "P"; + +/* South by east, long */ +"COMPASS_SbE_LONG" = "pietūs į rytus"; + +/* South by east, short */ +"COMPASS_SbE_SHORT" = "PįR"; + +/* South by west, long */ +"COMPASS_SbW_LONG" = "pietūs į vakarus"; + +/* South by west, short */ +"COMPASS_SbW_SHORT" = "PįV"; + +/* Southeast, long */ +"COMPASS_SE_LONG" = "pietryčiai"; + +/* Southeast, short */ +"COMPASS_SE_SHORT" = "PR"; + +/* Southeast by east, long */ +"COMPASS_SEbE_LONG" = "pietryčiai į rytus"; + +/* Southeast by east, short */ +"COMPASS_SEbE_SHORT" = "PRįR"; + +/* Southeast by south, long */ +"COMPASS_SEbS_LONG" = "pietryčiai į pietus"; + +/* Southeast by south, short */ +"COMPASS_SEbS_SHORT" = "PRįP"; + +/* South-southeast, long */ +"COMPASS_SSE_LONG" = "pietūs - pietryčiai"; + +/* South-southeast, short */ +"COMPASS_SSE_SHORT" = "PPR"; + +/* South-southwest, long */ +"COMPASS_SSW_LONG" = "pietūs - pietvakariai"; + +/* South-southwest, short */ +"COMPASS_SSW_SHORT" = "PPV"; + +/* Southwest, long */ +"COMPASS_SW_LONG" = "pietvakariai"; + +/* Southwest, short */ +"COMPASS_SW_SHORT" = "PV"; + +/* Southwest by south, long */ +"COMPASS_SWbS_LONG" = "pietvakariai į pietus"; + +/* Southwest by south, short */ +"COMPASS_SWbS_SHORT" = "PVįP"; + +/* Southwest by west, long */ +"COMPASS_SWbW_LONG" = "pietvakariai į vakarus"; + +/* Southwest by west, short */ +"COMPASS_SWbW_SHORT" = "PVįV"; + +/* West, long */ +"COMPASS_W_LONG" = "vakarai"; + +/* West, short */ +"COMPASS_W_SHORT" = "V"; + +/* West by north, long */ +"COMPASS_WbN_LONG" = "vakarai į šiaurę"; + +/* West by north, short */ +"COMPASS_WbN_SHORT" = "VįŠ"; + +/* West by south, long */ +"COMPASS_WbS_LONG" = "vakarai į pietus"; + +/* West by south, short */ +"COMPASS_WbS_SHORT" = "VįP"; + +/* West-northwest, long */ +"COMPASS_WNW_LONG" = "vakarai - šiaurės vakarai"; + +/* West-northwest, short */ +"COMPASS_WNW_SHORT" = "VŠV"; + +/* West-southwest, long */ +"COMPASS_WSW_LONG" = "vakarai - pietvakariai"; + +/* West-southwest, short */ +"COMPASS_WSW_SHORT" = "VPV"; + +/* Degrees format, long */ +"COORD_DEG_LONG" = "%d laipsniai(-ių)"; + +/* Degrees format, medium: {degrees} */ +"COORD_DEG_MEDIUM" = "%d°"; + +/* Degrees format, short: {degrees} */ +"COORD_DEG_SHORT" = "%d°"; + +/* Coordinate format, long: {degrees}{minutes} */ +"COORD_DM_LONG" = "%1$@ ir %2$@"; + +/* Coordinate format, medium: {degrees}{minutes} */ +"COORD_DM_MEDIUM" = "%1$@%2$@"; + +/* Coordinate format, short: {degrees}{minutes} */ +"COORD_DM_SHORT" = "%1$@%2$@"; + +/* Coordinate format, long: {degrees}{minutes}{seconds} */ +"COORD_DMS_LONG" = "%1$@, %2$@ ir %3$@"; + +/* Coordinate format, medium: {degrees}{minutes}{seconds} */ +"COORD_DMS_MEDIUM" = "%1$@%2$@%3$@"; + +/* Coordinate format, short: {degrees}{minutes}{seconds} */ +"COORD_DMS_SHORT" = "%1$@%2$@%3$@"; + +/* East longitude format, long: {longitude} */ +"COORD_E_LONG" = "%@ ritų ilgumos"; + +/* East longitude format, medium: {longitude} */ +"COORD_E_MEDIUM" = "%@ į rytus"; + +/* East longitude format, short: {longitude} */ +"COORD_E_SHORT" = "%@R"; + +/* Coordinate pair format, long: {latitude}, {longitude} */ +"COORD_FMT_LONG" = "%1$@, %2$@"; + +/* Coordinate pair format, medium: {latitude}, {longitude} */ +"COORD_FMT_MEDIUM" = "%1$@, %2$@"; + +/* Coordinate pair format, short: {latitude}, {longitude} */ +"COORD_FMT_SHORT" = "%1$@, %2$@"; + +/* Minutes format, long */ +"COORD_MIN_LONG" = "%d minutė(s)"; + +/* Minutes format, medium: {minutes} */ +"COORD_MIN_MEDIUM" = "%d′"; + +/* Minutes format, short: {minutes} */ +"COORD_MIN_SHORT" = "%d′"; + +/* North latitude format, long: {latitude} */ +"COORD_N_LONG" = "%@ šiaurės platumos"; + +/* North latitude format, medium: {latitude} */ +"COORD_N_MEDIUM" = "%@ į šiaurę"; + +/* North latitude format, short: {latitude} */ +"COORD_N_SHORT" = "%@Š"; + +/* South latitude format, long: {latitude} */ +"COORD_S_LONG" = "%@ pietų platumos"; + +/* South latitude format, medium: {latitude} */ +"COORD_S_MEDIUM" = "%@ į pietus"; + +/* South latitude format, short: {latitude} */ +"COORD_S_SHORT" = "%@P"; + +/* Seconds format, long */ +"COORD_SEC_LONG" = "%d sekundės(-ių)"; + +/* Seconds format, medium: {seconds} */ +"COORD_SEC_MEDIUM" = "%d″"; + +/* Seconds format, short: {seconds} */ +"COORD_SEC_SHORT" = "%d″"; + +/* West longitude format, long: {longitude} */ +"COORD_W_LONG" = "%@ vakarų ilgumos"; + +/* West longitude format, medium: {longitude} */ +"COORD_W_MEDIUM" = "%@ į vakarus"; + +/* West longitude format, short: {longitude} */ +"COORD_W_SHORT" = "%@V"; + diff --git a/platform/darwin/resources/lt.lproj/Foundation.stringsdict b/platform/darwin/resources/lt.lproj/Foundation.stringsdict new file mode 100644 index 0000000000..e3bb31838a --- /dev/null +++ b/platform/darwin/resources/lt.lproj/Foundation.stringsdict @@ -0,0 +1,66 @@ + + + + + COORD_DEG_LONG + + NSStringLocalizedFormatKey + %#@degrees@ + degrees + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + one + %d laipsniai + few + %d laipsniai + many + %d laipsniai + other + %d laipsnių + + + COORD_MIN_LONG + + NSStringLocalizedFormatKey + %#@minutes@ + minutes + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + one + %d minutė + few + %d minutės + many + %d minutės + other + %d minučių + + + COORD_SEC_LONG + + NSStringLocalizedFormatKey + %#@seconds@ + seconds + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + one + %d sekundė + few + %d sekundės + many + %d sekundės + other + %d sekundžių + + + + diff --git a/platform/darwin/resources/pl.lproj/Foundation.stringsdict b/platform/darwin/resources/pl.lproj/Foundation.stringsdict index 016ba06b81..5a4f208562 100644 --- a/platform/darwin/resources/pl.lproj/Foundation.stringsdict +++ b/platform/darwin/resources/pl.lproj/Foundation.stringsdict @@ -18,6 +18,8 @@ %d stopnie many %d stopni + other + %d stopnia COORD_MIN_LONG @@ -36,6 +38,8 @@ %d minuty many %d minut + other + %d minuty COORD_SEC_LONG @@ -54,6 +58,8 @@ %d sekundy many %d sekund + other + %d sekundy diff --git a/platform/darwin/resources/ru.lproj/Foundation.stringsdict b/platform/darwin/resources/ru.lproj/Foundation.stringsdict index b2d7467fd4..337cea0164 100644 --- a/platform/darwin/resources/ru.lproj/Foundation.stringsdict +++ b/platform/darwin/resources/ru.lproj/Foundation.stringsdict @@ -18,6 +18,8 @@ %d градуса many %d градусов + other + %d градуса COORD_MIN_LONG @@ -36,6 +38,8 @@ %d минуты many %d минут + other + %d минуты COORD_SEC_LONG @@ -54,6 +58,8 @@ %d секунды many %d секунд + other + %d секунды diff --git a/platform/darwin/resources/uk.lproj/Foundation.stringsdict b/platform/darwin/resources/uk.lproj/Foundation.stringsdict index 76dbbfc5e9..f35f0516e1 100644 --- a/platform/darwin/resources/uk.lproj/Foundation.stringsdict +++ b/platform/darwin/resources/uk.lproj/Foundation.stringsdict @@ -18,6 +18,8 @@ %d градуси many %d градусів + other + %d градуса COORD_MIN_LONG @@ -31,11 +33,13 @@ NSStringFormatValueTypeKey d one - %d хвилина + %d мінута few - %d хвилини + %d мінути many - %d хвилин + %d мінут + other + %d мінути COORD_SEC_LONG @@ -54,6 +58,8 @@ %d секунди many %d секунд + other + %d секунди diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 8e18b353f9..bfbb854289 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -15,8 +15,8 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Added support for right-to-left text and Arabic ligatures in labels. ([#6984](https://github.com/mapbox/mapbox-gl-native/pull/6984), [#7123](https://github.com/mapbox/mapbox-gl-native/pull/7123)) * Improved the line wrapping behavior of point-placed labels, especially labels written in Chinese and Japanese. ([#6828](https://github.com/mapbox/mapbox-gl-native/pull/6828), [#7446](https://github.com/mapbox/mapbox-gl-native/pull/7446)) * CJK characters now remain upright in vertically oriented labels that have line placement, such as road labels. ([#7114](https://github.com/mapbox/mapbox-gl-native/issues/7114)) -* Added Chinese (Simplified and Traditional), French, German, Japanese, Lithuanian, Polish, Portuguese (Brazilian), Russian, Spanish, Swedish, Ukrainian, and Vietnamese localizations. ([#7316](https://github.com/mapbox/mapbox-gl-native/pull/7316), [#7899](https://github.com/mapbox/mapbox-gl-native/pull/7899), [#7999](https://github.com/mapbox/mapbox-gl-native/pull/7999), -[#8113](https://github.com/mapbox/mapbox-gl-native/pull/8113)) +* Added Catalan, Chinese (Simplified and Traditional), Dutch, Finnish, French, German, Japanese, Lithuanian, Polish, Portuguese (Brazilian), Russian, Spanish, Swedish, Ukrainian, and Vietnamese localizations. ([#7316](https://github.com/mapbox/mapbox-gl-native/pull/7316), [#7899](https://github.com/mapbox/mapbox-gl-native/pull/7899), [#7999](https://github.com/mapbox/mapbox-gl-native/pull/7999), +[#8113](https://github.com/mapbox/mapbox-gl-native/pull/8113), [#8256](https://github.com/mapbox/mapbox-gl-native/pull/8256)) ### Styles diff --git a/platform/ios/app/ca.lproj/Localizable.strings b/platform/ios/app/ca.lproj/Localizable.strings new file mode 100644 index 0000000000..e69de29bb2 diff --git a/platform/ios/app/fi.lproj/Localizable.strings b/platform/ios/app/fi.lproj/Localizable.strings new file mode 100644 index 0000000000..e69de29bb2 diff --git a/platform/ios/app/nl.lproj/Localizable.strings b/platform/ios/app/nl.lproj/Localizable.strings new file mode 100644 index 0000000000..e69de29bb2 diff --git a/platform/ios/framework/Settings.bundle/ca.lproj/Root.strings b/platform/ios/framework/Settings.bundle/ca.lproj/Root.strings new file mode 100644 index 0000000000..94e8335582 --- /dev/null +++ b/platform/ios/framework/Settings.bundle/ca.lproj/Root.strings @@ -0,0 +1,3 @@ +"TELEMETRY_GROUP_TITLE" = "Configuració de privacitat"; +"TELEMETRY_SWITCH_TITLE" = "Telemetria Mapbox"; +"TELEMETRY_GROUP_FOOTER" = "Aquest ajust permet que l’aplicació comparteixi dades anònimes de localització i ús amb Mapbox."; diff --git a/platform/ios/framework/Settings.bundle/fi.lproj/Root.strings b/platform/ios/framework/Settings.bundle/fi.lproj/Root.strings new file mode 100644 index 0000000000..e0c2e50d09 --- /dev/null +++ b/platform/ios/framework/Settings.bundle/fi.lproj/Root.strings @@ -0,0 +1,3 @@ +"TELEMETRY_GROUP_TITLE" = "Yksityisyysasetukset"; +"TELEMETRY_SWITCH_TITLE" = "Mapbox-telemetria"; +"TELEMETRY_GROUP_FOOTER" = "Tämä asetus antaa sovellukselle luvan jakaa anonymisoituja sijainti- ja käyttötietoja Mapboxille."; diff --git a/platform/ios/framework/Settings.bundle/nl.lproj/Root.strings b/platform/ios/framework/Settings.bundle/nl.lproj/Root.strings new file mode 100644 index 0000000000..ea73b0ba3c --- /dev/null +++ b/platform/ios/framework/Settings.bundle/nl.lproj/Root.strings @@ -0,0 +1,3 @@ +"TELEMETRY_GROUP_TITLE" = "Privacy Instellingen"; +"TELEMETRY_SWITCH_TITLE" = "Mapbox Telemetrie"; +"TELEMETRY_GROUP_FOOTER" = "Deze instelling laat toe om anonieme locatie en gebruiksgegevens te delen met Mapbox."; diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index 3256e304af..bb69a3761e 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -717,6 +717,17 @@ DA4A26961CB6E795000B7809 /* Mapbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Mapbox.framework; sourceTree = BUILT_PRODUCTS_DIR; }; DA6023F11E4CE94300DBFF23 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Foundation.strings; sourceTree = ""; }; DA6023F21E4CE94800DBFF23 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = sv; path = sv.lproj/Foundation.stringsdict; sourceTree = ""; }; + DA618B111E68823600CB7F44 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ru; path = ru.lproj/Localizable.stringsdict; sourceTree = ""; }; + DA618B191E68883700CB7F44 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ca; path = ca.lproj/Localizable.stringsdict; sourceTree = ""; }; + DA618B1A1E68883900CB7F44 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Localizable.strings; sourceTree = ""; }; + DA618B1B1E68884E00CB7F44 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Localizable.strings; sourceTree = ""; }; + DA618B1C1E6888EC00CB7F44 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Foundation.strings; sourceTree = ""; }; + DA618B1D1E6888F500CB7F44 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ca; path = ca.lproj/Foundation.stringsdict; sourceTree = ""; }; + DA618B1E1E688A3700CB7F44 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Root.strings; sourceTree = ""; }; + DA618B251E68920500CB7F44 /* lt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = lt; path = lt.lproj/Foundation.strings; sourceTree = ""; }; + DA618B261E68920D00CB7F44 /* lt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = lt; path = lt.lproj/Foundation.stringsdict; sourceTree = ""; }; + DA618B2B1E68932D00CB7F44 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Localizable.strings; sourceTree = ""; }; + DA618B2C1E68933600CB7F44 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Root.strings; sourceTree = ""; }; DA6408D91DA4E7D300908C90 /* MGLVectorStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLVectorStyleLayer.h; sourceTree = ""; }; DA6408DA1DA4E7D300908C90 /* MGLVectorStyleLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLVectorStyleLayer.m; sourceTree = ""; }; DA7262091DEEE3480043BB89 /* MGLOpenGLStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLOpenGLStyleLayer.h; sourceTree = ""; }; @@ -728,7 +739,7 @@ DA737AE11E59157600AD2CDE /* pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Root.strings; sourceTree = ""; }; DA737AE51E5916D400AD2CDE /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ru; path = ru.lproj/Foundation.stringsdict; sourceTree = ""; }; DA737AE61E59171700AD2CDE /* ru */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Root.strings; sourceTree = ""; }; - DA737AE71E59172C00AD2CDE /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = ""; }; + DA737AE71E59172C00AD2CDE /* ru */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = ""; }; DA737AE91E5917C300AD2CDE /* uk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Localizable.strings; sourceTree = ""; }; DA737AEA1E5917EF00AD2CDE /* uk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Root.strings; sourceTree = ""; }; DA737EE01D056A4E005BDA16 /* MGLMapViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLMapViewDelegate.h; sourceTree = ""; }; @@ -873,6 +884,8 @@ DAD165761CF4CDFF001FF4B9 /* MGLShapeCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLShapeCollection.h; sourceTree = ""; }; DAD165771CF4CDFF001FF4B9 /* MGLShapeCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLShapeCollection.mm; sourceTree = ""; }; DAE7DEC11E245455007505A6 /* MGLNSStringAdditionsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLNSStringAdditionsTests.m; path = ../../darwin/test/MGLNSStringAdditionsTests.m; sourceTree = ""; }; + DAE8CCAD1E6E8C70009B5CB0 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; + DAE8CCAE1E6E8C76009B5CB0 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Root.strings; sourceTree = ""; }; DAED38611D62D0FC00D7640F /* NSURL+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+MGLAdditions.h"; sourceTree = ""; }; DAED38621D62D0FC00D7640F /* NSURL+MGLAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURL+MGLAdditions.m"; sourceTree = ""; }; DAEDC4331D603417000224FF /* MGLAttributionInfoTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLAttributionInfoTests.m; path = ../../darwin/test/MGLAttributionInfoTests.m; sourceTree = ""; }; @@ -1925,6 +1938,9 @@ ru, uk, lt, + ca, + fi, + nl, ); mainGroup = DA1DC9411CB6C1C2006E619F; productRefGroup = DA1DC94B1CB6C1C2006E619F /* Products */; @@ -2317,6 +2333,9 @@ 9660916D1E5BBFDB00A9A03B /* ru */, 9660916E1E5BBFDC00A9A03B /* uk */, 9660916F1E5BBFDE00A9A03B /* lt */, + DA618B1A1E68883900CB7F44 /* ca */, + DA618B2B1E68932D00CB7F44 /* fi */, + DAE8CCAD1E6E8C70009B5CB0 /* nl */, ); name = Localizable.strings; sourceTree = ""; @@ -2337,6 +2356,9 @@ DA737AE61E59171700AD2CDE /* ru */, DA737AEA1E5917EF00AD2CDE /* uk */, DA1AC01C1E5B87EC006DF1D6 /* lt */, + DA618B1E1E688A3700CB7F44 /* ca */, + DA618B2C1E68933600CB7F44 /* fi */, + DAE8CCAE1E6E8C76009B5CB0 /* nl */, ); name = Root.strings; sourceTree = ""; @@ -2357,6 +2379,7 @@ DA737AE71E59172C00AD2CDE /* ru */, DA737AE91E5917C300AD2CDE /* uk */, DA1AC01B1E5B8774006DF1D6 /* lt */, + DA618B1B1E68884E00CB7F44 /* ca */, ); name = Localizable.strings; sourceTree = ""; @@ -2371,6 +2394,8 @@ DAA32CB51E4C4CF4006F8D24 /* ja */, DAA32CBD1E4C4F62006F8D24 /* vi */, DA6023F11E4CE94300DBFF23 /* sv */, + DA618B1C1E6888EC00CB7F44 /* ca */, + DA618B251E68920500CB7F44 /* lt */, ); name = Foundation.strings; sourceTree = ""; @@ -2387,6 +2412,8 @@ DA737AE01E59150A00AD2CDE /* pl */, DA737AE51E5916D400AD2CDE /* ru */, DA1AC0201E5B8917006DF1D6 /* uk */, + DA618B1D1E6888F500CB7F44 /* ca */, + DA618B261E68920D00CB7F44 /* lt */, ); name = Foundation.stringsdict; sourceTree = ""; @@ -2406,6 +2433,8 @@ DAA32CA21E4C44DD006F8D24 /* de */, DAA32CA91E4C4919006F8D24 /* fr */, DA9C012B1E4C7AD900C4742A /* pt-BR */, + DA618B111E68823600CB7F44 /* ru */, + DA618B191E68883700CB7F44 /* ca */, ); name = Localizable.stringsdict; sourceTree = ""; diff --git a/platform/ios/resources/ca.lproj/Localizable.strings b/platform/ios/resources/ca.lproj/Localizable.strings new file mode 100644 index 0000000000..aec7226e6b --- /dev/null +++ b/platform/ios/resources/ca.lproj/Localizable.strings @@ -0,0 +1,75 @@ +/* Accessibility hint */ +"ANNOTATION_A11Y_HINT" = "Mostra més informació"; + +/* No comment provided by engineer. */ +"API_CLIENT_400_DESC" = "La tasca de dades de la sessió ha fallat. La petició original era: %@"; + +/* No comment provided by engineer. */ +"API_CLIENT_400_REASON" = "El codi d’estat era %ld"; + +/* No comment provided by engineer. */ +"CANCEL" = "Cancel·lar"; + +/* Accessibility hint */ +"COMPASS_A11Y_HINT" = "Orienta el mapa amb rumb nord"; + +/* Accessibility label */ +"COMPASS_A11Y_LABEL" = "Brúixola"; + +/* Compass abbreviation for north */ +"COMPASS_NORTH" = "N"; + +/* Instructions in Interface Builder designable; {key}, {plist file name} */ +"DESIGNABLE" = "Per mostrar aquí un mapa allotjat a Mapbox posa %1$@ al teu token d’accés a %2$@\n\nPer obtenir instruccions detallades, consulteu:"; + +/* Setup documentation URL display string; keep as short as possible */ +"FIRST_STEPS_URL" = "mapbox.com/help/first-steps-ios-sdk"; + +/* Accessibility hint */ +"INFO_A11Y_HINT" = "Mostra els crèdits, el formulari de contacte i més"; + +/* Accessibility label */ +"INFO_A11Y_LABEL" = "Sobre aquest mapa"; + +/* Accessibility label */ +"LOGO_A11Y_LABEL" = "Mapbox"; + +/* Accessibility label */ +"MAP_A11Y_LABEL" = "Mapa"; + +/* Map accessibility value */ +"MAP_A11Y_VALUE" = "Zoom %1$dx\n%2$ld anotació (ns) visibles"; + +/* Action sheet title */ +"SDK_NAME" = "Mapbox iOS SDK"; + +/* Telemetry prompt message */ +"TELEMETRY_DISABLED_MSG" = "Pots ajudar a millorar els mapes d’OpenStreetMap i de Mapbox aportant dades d’ús anònimes."; + +/* Telemetry prompt button */ +"TELEMETRY_DISABLED_OFF" = "No vull participar"; + +/* Telemetry prompt button */ +"TELEMETRY_DISABLED_ON" = "Participar"; + +/* Telemetry prompt message */ +"TELEMETRY_ENABLED_MSG" = "Estàs ajudant a millorar els mapes d’OpenStreetMap i de Mapbox aportant dades d’ús anònimes."; + +/* Telemetry prompt button */ +"TELEMETRY_ENABLED_OFF" = "Aturar la participació"; + +/* Telemetry prompt button */ +"TELEMETRY_ENABLED_ON" = "Continuar la participació"; + +/* Telemetry prompt button */ +"TELEMETRY_MORE" = "Vull saber-ne més"; + +/* Action in attribution sheet */ +"TELEMETRY_NAME" = "Telemetria de Mapbox"; + +/* Telemetry prompt title */ +"TELEMETRY_TITLE" = "Millora els mapes de Mapbox"; + +/* Default user location annotation title */ +"USER_DOT_TITLE" = "Ets aquí"; + diff --git a/platform/ios/resources/ca.lproj/Localizable.stringsdict b/platform/ios/resources/ca.lproj/Localizable.stringsdict new file mode 100644 index 0000000000..85a839d870 --- /dev/null +++ b/platform/ios/resources/ca.lproj/Localizable.stringsdict @@ -0,0 +1,23 @@ + + + + + MAP_A11Y_VALUE + + NSStringLocalizedFormatKey + Zoom %dx +%#@count@ visible + count + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + ld + one + %d anotació + other + %d anotacions + + + + diff --git a/platform/ios/resources/ru.lproj/Localizable.strings b/platform/ios/resources/ru.lproj/Localizable.strings index c895e34cee..1c3b46f057 100644 --- a/platform/ios/resources/ru.lproj/Localizable.strings +++ b/platform/ios/resources/ru.lproj/Localizable.strings @@ -20,7 +20,7 @@ "COMPASS_NORTH" = "N"; /* Instructions in Interface Builder designable; {key}, {plist file name} */ -"DESIGNABLE" = "To display a Mapbox-hosted map here, set %1$@ to your access token in %2$@\n\nFor detailed instructions, see:"; +"DESIGNABLE" = "Для отображения здесь карт Mapbox задайте %1$@ к вашему токену доступа в %2$@\n\nПодробные инструкции см.:"; /* Setup documentation URL display string; keep as short as possible */ "FIRST_STEPS_URL" = "mapbox.com/help/first-steps-ios-sdk"; @@ -38,13 +38,13 @@ "MAP_A11Y_LABEL" = "Карта"; /* Map accessibility value */ -"MAP_A11Y_VALUE" = "Zoom %1$dx\n%2$ld annotation(s) visible"; +"MAP_A11Y_VALUE" = "Масштаб %1$dx\n%2$ld аннотации(й) видны"; /* Action sheet title */ "SDK_NAME" = "Mapbox iOS SDK"; /* Telemetry prompt message */ -"TELEMETRY_DISABLED_MSG" = "You can help make OpenStreetMap and Mapbox maps better by contributing anonymous usage data."; +"TELEMETRY_DISABLED_MSG" = "Вы можете помочь сделать карты OpenStreetMap и Mapbox лучше путем предоставления анонимных данных об использовании."; /* Telemetry prompt button */ "TELEMETRY_DISABLED_OFF" = "Не участвовать"; @@ -53,7 +53,7 @@ "TELEMETRY_DISABLED_ON" = "Участвовать"; /* Telemetry prompt message */ -"TELEMETRY_ENABLED_MSG" = "You are helping to make OpenStreetMap and Mapbox maps better by contributing anonymous usage data."; +"TELEMETRY_ENABLED_MSG" = "Вы помогаете сделать карты OpenStreetMap и Mapbox лучше путем предоставления анонимных данных об использовании."; /* Telemetry prompt button */ "TELEMETRY_ENABLED_OFF" = "Прекратить участие"; diff --git a/platform/ios/resources/ru.lproj/Localizable.stringsdict b/platform/ios/resources/ru.lproj/Localizable.stringsdict new file mode 100644 index 0000000000..49f9cc4621 --- /dev/null +++ b/platform/ios/resources/ru.lproj/Localizable.stringsdict @@ -0,0 +1,27 @@ + + + + + MAP_A11Y_VALUE + + NSStringLocalizedFormatKey + Zoom %dx +%#@count@ visible + count + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + ld + one + %d аннотация + few + %d аннотации + many + %d аннотаций + other + %d аннотации + + + + diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index 76efbc2a0d..b809ef9a24 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -7,8 +7,8 @@ * Added support for right-to-left text and Arabic ligatures in labels. ([#6984](https://github.com/mapbox/mapbox-gl-native/pull/6984), [#7123](https://github.com/mapbox/mapbox-gl-native/pull/7123)) * Improved the line wrapping behavior of point-placed labels, especially labels written in Chinese and Japanese. ([#6828](https://github.com/mapbox/mapbox-gl-native/pull/6828), [#7446](https://github.com/mapbox/mapbox-gl-native/pull/7446)) * CJK characters now remain upright in vertically oriented labels that have line placement, such as road labels. ([#7114](https://github.com/mapbox/mapbox-gl-native/issues/7114)) -* Added Chinese (Simplified and Traditional), French, German, Japanese, Lithuanian, Polish, Portuguese (Brazilian), Spanish, Swedish, Ukrainian, and Vietnamese localizations. ([#7316](https://github.com/mapbox/mapbox-gl-native/pull/7316), [#7503](https://github.com/mapbox/mapbox-gl-native/pull/7503), [#7899](https://github.com/mapbox/mapbox-gl-native/pull/7899), [#7999](https://github.com/mapbox/mapbox-gl-native/pull/7999), -[#8113](https://github.com/mapbox/mapbox-gl-native/pull/8113)) +* Added Catalan, Chinese (Simplified and Traditional), Dutch, Finnish, French, German, Japanese, Lithuanian, Polish, Portuguese (Brazilian), Spanish, Swedish, Ukrainian, and Vietnamese localizations. ([#7316](https://github.com/mapbox/mapbox-gl-native/pull/7316), [#7503](https://github.com/mapbox/mapbox-gl-native/pull/7503), [#7899](https://github.com/mapbox/mapbox-gl-native/pull/7899), [#7999](https://github.com/mapbox/mapbox-gl-native/pull/7999), +[#8113](https://github.com/mapbox/mapbox-gl-native/pull/8113), [#8256](https://github.com/mapbox/mapbox-gl-native/pull/8256)) ### Styles diff --git a/platform/macos/app/ca.lproj/Localizable.strings b/platform/macos/app/ca.lproj/Localizable.strings new file mode 100644 index 0000000000..e69de29bb2 diff --git a/platform/macos/app/fi.lproj/Localizable.strings b/platform/macos/app/fi.lproj/Localizable.strings new file mode 100644 index 0000000000..e69de29bb2 diff --git a/platform/macos/app/nl.lproj/Localizable.strings b/platform/macos/app/nl.lproj/Localizable.strings new file mode 100644 index 0000000000..e69de29bb2 diff --git a/platform/macos/app/ru.lproj/Localizable.strings b/platform/macos/app/ru.lproj/Localizable.strings new file mode 100644 index 0000000000..e69de29bb2 diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj index 47647eba25..d76a225edb 100644 --- a/platform/macos/macos.xcodeproj/project.pbxproj +++ b/platform/macos/macos.xcodeproj/project.pbxproj @@ -372,6 +372,16 @@ DA5589761D320C41006B7F64 /* wms.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = wms.json; sourceTree = ""; }; DA6023EF1E4CE8E500DBFF23 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Foundation.strings; sourceTree = ""; }; DA6023F01E4CE8FF00DBFF23 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = sv; path = sv.lproj/Foundation.stringsdict; sourceTree = ""; }; + DA618B131E68850300CB7F44 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = ""; }; + DA618B141E68852C00CB7F44 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = ""; }; + DA618B151E6886DF00CB7F44 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ca; path = ca.lproj/Foundation.stringsdict; sourceTree = ""; }; + DA618B161E6886E000CB7F44 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Localizable.strings; sourceTree = ""; }; + DA618B171E68876C00CB7F44 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Foundation.strings; sourceTree = ""; }; + DA618B181E6887C600CB7F44 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Localizable.strings; sourceTree = ""; }; + DA618B231E6891ED00CB7F44 /* lt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = lt; path = lt.lproj/Foundation.strings; sourceTree = ""; }; + DA618B241E6891F300CB7F44 /* lt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = lt; path = lt.lproj/Foundation.stringsdict; sourceTree = ""; }; + DA618B271E68926E00CB7F44 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Localizable.strings; sourceTree = ""; }; + DA618B2A1E6892B500CB7F44 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Localizable.strings; sourceTree = ""; }; DA6408D51DA4E5DA00908C90 /* MGLVectorStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLVectorStyleLayer.h; sourceTree = ""; }; DA6408D61DA4E5DA00908C90 /* MGLVectorStyleLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLVectorStyleLayer.m; sourceTree = ""; }; DA7262051DEEDD460043BB89 /* MGLOpenGLStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLOpenGLStyleLayer.h; sourceTree = ""; }; @@ -531,6 +541,9 @@ DAE6C3CA1CC34BD800DB3429 /* MGLOfflineRegionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLOfflineRegionTests.m; path = ../../darwin/test/MGLOfflineRegionTests.m; sourceTree = ""; }; DAE6C3CC1CC34BD800DB3429 /* MGLStyleTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLStyleTests.mm; path = ../../darwin/test/MGLStyleTests.mm; sourceTree = ""; }; DAE7DEC31E24549F007505A6 /* MGLNSStringAdditionsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLNSStringAdditionsTests.m; path = ../../darwin/test/MGLNSStringAdditionsTests.m; sourceTree = ""; }; + DAE8CCAA1E6E8605009B5CB0 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ru; path = ru.lproj/Foundation.stringsdict; sourceTree = ""; }; + DAE8CCAB1E6E8B72009B5CB0 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; + DAE8CCAC1E6E8B8D009B5CB0 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; DAED385D1D62CED700D7640F /* NSURL+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+MGLAdditions.h"; sourceTree = ""; }; DAED385E1D62CED700D7640F /* NSURL+MGLAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURL+MGLAdditions.m"; sourceTree = ""; }; DAEDC4311D6033F1000224FF /* MGLAttributionInfoTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLAttributionInfoTests.m; path = ../../darwin/test/MGLAttributionInfoTests.m; sourceTree = ""; }; @@ -1250,6 +1263,10 @@ pl, uk, lt, + ru, + ca, + fi, + nl, ); mainGroup = DA839E891CC2E3400062CAFB; productRefGroup = DA839E931CC2E3400062CAFB /* Products */; @@ -1462,6 +1479,10 @@ 966091711E5BBFF900A9A03B /* pl */, 966091721E5BBFFA00A9A03B /* uk */, 966091731E5BBFFA00A9A03B /* lt */, + DA618B131E68850300CB7F44 /* ru */, + DA618B161E6886E000CB7F44 /* ca */, + DA618B271E68926E00CB7F44 /* fi */, + DAE8CCAB1E6E8B72009B5CB0 /* nl */, ); name = Localizable.strings; sourceTree = ""; @@ -1506,6 +1527,10 @@ DA737AE41E5915B000AD2CDE /* pl */, DA737AEC1E59180E00AD2CDE /* uk */, DA1AC01E1E5B8826006DF1D6 /* lt */, + DA618B141E68852C00CB7F44 /* ru */, + DA618B181E6887C600CB7F44 /* ca */, + DA618B2A1E6892B500CB7F44 /* fi */, + DAE8CCAC1E6E8B8D009B5CB0 /* nl */, ); name = Localizable.strings; sourceTree = ""; @@ -1520,6 +1545,8 @@ DAA32CB21E4C4CB7006F8D24 /* ja */, DAA32CC01E4C4F89006F8D24 /* vi */, DA6023EF1E4CE8E500DBFF23 /* sv */, + DA618B171E68876C00CB7F44 /* ca */, + DA618B231E6891ED00CB7F44 /* lt */, ); name = Foundation.strings; sourceTree = ""; @@ -1535,6 +1562,9 @@ DA737ADE1E5914AD00AD2CDE /* es */, DA737AE31E5915A500AD2CDE /* pl */, DA1AC01F1E5B8904006DF1D6 /* uk */, + DAE8CCAA1E6E8605009B5CB0 /* ru */, + DA618B151E6886DF00CB7F44 /* ca */, + DA618B241E6891F300CB7F44 /* lt */, ); name = Foundation.stringsdict; sourceTree = ""; diff --git a/platform/macos/sdk/ca.lproj/Localizable.strings b/platform/macos/sdk/ca.lproj/Localizable.strings new file mode 100644 index 0000000000..b679fa0459 --- /dev/null +++ b/platform/macos/sdk/ca.lproj/Localizable.strings @@ -0,0 +1,15 @@ +/* Accessibility title */ +"MAP_A11Y_TITLE" = "Mapbox"; + +/* Label of Zoom In button */ +"ZOOM_IN_LABEL" = "+"; + +/* Tooltip of Zoom In button */ +"ZOOM_IN_TOOLTIP" = "Apropar"; + +/* Label of Zoom Out button; U+2212 MINUS SIGN */ +"ZOOM_OUT_LABEL" = "−"; + +/* Tooltip of Zoom Out button */ +"ZOOM_OUT_TOOLTIP" = "Allunyar"; + diff --git a/platform/macos/sdk/fi.lproj/Localizable.strings b/platform/macos/sdk/fi.lproj/Localizable.strings new file mode 100644 index 0000000000..071cc3558b --- /dev/null +++ b/platform/macos/sdk/fi.lproj/Localizable.strings @@ -0,0 +1,15 @@ +/* Accessibility title */ +"MAP_A11Y_TITLE" = "Mapbox"; + +/* Label of Zoom In button */ +"ZOOM_IN_LABEL" = "+"; + +/* Tooltip of Zoom In button */ +"ZOOM_IN_TOOLTIP" = "Lähennä"; + +/* Label of Zoom Out button; U+2212 MINUS SIGN */ +"ZOOM_OUT_LABEL" = "−"; + +/* Tooltip of Zoom Out button */ +"ZOOM_OUT_TOOLTIP" = "Loitonna"; + diff --git a/platform/macos/sdk/nl.lproj/Localizable.strings b/platform/macos/sdk/nl.lproj/Localizable.strings new file mode 100644 index 0000000000..8e7b0ae45f --- /dev/null +++ b/platform/macos/sdk/nl.lproj/Localizable.strings @@ -0,0 +1,15 @@ +/* Accessibility title */ +"MAP_A11Y_TITLE" = "Mapbox"; + +/* Label of Zoom In button */ +"ZOOM_IN_LABEL" = "+"; + +/* Tooltip of Zoom In button */ +"ZOOM_IN_TOOLTIP" = "Inzoomen"; + +/* Label of Zoom Out button; U+2212 MINUS SIGN */ +"ZOOM_OUT_LABEL" = "−"; + +/* Tooltip of Zoom Out button */ +"ZOOM_OUT_TOOLTIP" = "Uitzoomen"; + diff --git a/platform/macos/sdk/ru.lproj/Localizable.strings b/platform/macos/sdk/ru.lproj/Localizable.strings new file mode 100644 index 0000000000..4fa1104cc7 --- /dev/null +++ b/platform/macos/sdk/ru.lproj/Localizable.strings @@ -0,0 +1,15 @@ +/* Accessibility title */ +"MAP_A11Y_TITLE" = "Mapbox"; + +/* Label of Zoom In button */ +"ZOOM_IN_LABEL" = "+"; + +/* Tooltip of Zoom In button */ +"ZOOM_IN_TOOLTIP" = "Приблизить"; + +/* Label of Zoom Out button; U+2212 MINUS SIGN */ +"ZOOM_OUT_LABEL" = "−"; + +/* Tooltip of Zoom Out button */ +"ZOOM_OUT_TOOLTIP" = "Отдалить"; + -- cgit v1.2.1 From ffa78e2545d27d9ff4c79a6d80725318b834e074 Mon Sep 17 00:00:00 2001 From: Tobrun Date: Wed, 8 Mar 2017 09:39:20 -0800 Subject: [android] - don't disable tracking when animation the camera bearing. (#8279) --- .../src/main/java/com/mapbox/mapboxsdk/maps/TrackingSettings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform') diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/TrackingSettings.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/TrackingSettings.java index 38f307f149..476f4554c1 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/TrackingSettings.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/TrackingSettings.java @@ -281,7 +281,7 @@ public final class TrackingSettings { */ void resetTrackingModesIfRequired(CameraPosition cameraPosition) { if (isDismissTrackingModesForCameraPositionChange()) { - resetTrackingModesIfRequired(cameraPosition.target != null, cameraPosition.bearing != -1); + resetTrackingModesIfRequired(cameraPosition.target != null, false); } } -- cgit v1.2.1 From 05dd34f5842815e007b6152a4d25287537976462 Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Wed, 8 Mar 2017 13:15:52 -0800 Subject: [ios, macos] Removed duplicated NSDate test files, improved duration converstion for NSDate+MGLAdditions (#8290) --- platform/darwin/src/NSDate+MGLAdditions.mm | 5 +---- platform/darwin/test/MGLNSDateAdditionsTests.mm | 14 +++++++++++++ platform/ios/ios.xcodeproj/project.pbxproj | 8 ++++---- platform/ios/test/MGLNSDateAdditionsTests.mm | 26 ------------------------- platform/macos/macos.xcodeproj/project.pbxproj | 8 ++++---- platform/macos/test/MGLNSDateAdditionsTests.mm | 26 ------------------------- 6 files changed, 23 insertions(+), 64 deletions(-) delete mode 100644 platform/ios/test/MGLNSDateAdditionsTests.mm delete mode 100644 platform/macos/test/MGLNSDateAdditionsTests.mm (limited to 'platform') diff --git a/platform/darwin/src/NSDate+MGLAdditions.mm b/platform/darwin/src/NSDate+MGLAdditions.mm index 1739805e7c..b45b41f836 100644 --- a/platform/darwin/src/NSDate+MGLAdditions.mm +++ b/platform/darwin/src/NSDate+MGLAdditions.mm @@ -7,8 +7,5 @@ mbgl::Duration MGLDurationFromTimeInterval(NSTimeInterval duration) NSTimeInterval MGLTimeIntervalFromDuration(mbgl::Duration duration) { - std::chrono::nanoseconds nano(duration.count()); - std::chrono::seconds sec = std::chrono::duration_cast(nano); - - return sec.count(); + return std::chrono::duration>(duration).count(); } diff --git a/platform/darwin/test/MGLNSDateAdditionsTests.mm b/platform/darwin/test/MGLNSDateAdditionsTests.mm index 474fe763ff..6d8d951024 100644 --- a/platform/darwin/test/MGLNSDateAdditionsTests.mm +++ b/platform/darwin/test/MGLNSDateAdditionsTests.mm @@ -17,9 +17,23 @@ using namespace std::chrono_literals; NSTimeInterval durationTimeInterval = MGLTimeIntervalFromDuration(duration); mbgl::Duration expectedDuration = 5s; + mbgl::Duration expectedDurationMiliSeconds = 5000ms; + mbgl::Duration expectedDurationMicroSeconds = 5000000us; + mbgl::Duration expectedDurationNanoSeconds = 5000000000ns; XCTAssertEqual(timeInterval, durationTimeInterval); XCTAssertEqual(timeInterval, MGLTimeIntervalFromDuration(expectedDuration)); + XCTAssertEqual(timeInterval, MGLTimeIntervalFromDuration(expectedDurationMiliSeconds)); + XCTAssertEqual(timeInterval, MGLTimeIntervalFromDuration(expectedDurationMicroSeconds)); + XCTAssertEqual(timeInterval, MGLTimeIntervalFromDuration(expectedDurationNanoSeconds)); + + mbgl::Duration durationMiliSeconds = 2500ms; + mbgl::Duration durationMicroSeconds = 2500000us; + mbgl::Duration durationNanoSeconds = 2500000000ns; + + XCTAssertEqual(NSTimeInterval(2.5), MGLTimeIntervalFromDuration(durationMiliSeconds)); + XCTAssertEqual(NSTimeInterval(2.5), MGLTimeIntervalFromDuration(durationMicroSeconds)); + XCTAssertEqual(NSTimeInterval(2.5), MGLTimeIntervalFromDuration(durationNanoSeconds)); } diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index bb69a3761e..d7ca6f0643 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -9,7 +9,7 @@ /* Begin PBXBuildFile section */ 1753ED421E53CE6F00A9FD90 /* MGLConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1753ED411E53CE6F00A9FD90 /* MGLConversion.h */; }; 1753ED431E53CE6F00A9FD90 /* MGLConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1753ED411E53CE6F00A9FD90 /* MGLConversion.h */; }; - 1F131E341E6A35EC0055AF5B /* MGLNSDateAdditionsTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F131E331E6A35EC0055AF5B /* MGLNSDateAdditionsTests.mm */; }; + 1F95931D1E6DE2E900D5B294 /* MGLNSDateAdditionsTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F95931C1E6DE2E900D5B294 /* MGLNSDateAdditionsTests.mm */; }; 30E578171DAA85520050F07E /* UIImage+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E578111DAA7D690050F07E /* UIImage+MGLAdditions.h */; }; 30E578181DAA85520050F07E /* UIImage+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E578111DAA7D690050F07E /* UIImage+MGLAdditions.h */; }; 30E578191DAA855E0050F07E /* UIImage+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 30E578121DAA7D690050F07E /* UIImage+MGLAdditions.mm */; }; @@ -531,7 +531,7 @@ /* Begin PBXFileReference section */ 1753ED411E53CE6F00A9FD90 /* MGLConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLConversion.h; sourceTree = ""; }; - 1F131E331E6A35EC0055AF5B /* MGLNSDateAdditionsTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLNSDateAdditionsTests.mm; sourceTree = ""; }; + 1F95931C1E6DE2E900D5B294 /* MGLNSDateAdditionsTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLNSDateAdditionsTests.mm; path = ../../darwin/test/MGLNSDateAdditionsTests.mm; sourceTree = ""; }; 20DABE861DF78148007AC5FF /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Foundation.strings"; sourceTree = ""; }; 20DABE881DF78148007AC5FF /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; 20DABE8A1DF78149007AC5FF /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Root.strings"; sourceTree = ""; }; @@ -1196,7 +1196,7 @@ DA0CD58F1CF56F6A00A5F5A5 /* MGLFeatureTests.mm */, DA2E885C1CC0382C00F24E7B /* MGLGeometryTests.mm */, 35E208A61D24210F00EC9A46 /* MGLNSDataAdditionsTests.m */, - 1F131E331E6A35EC0055AF5B /* MGLNSDateAdditionsTests.mm */, + 1F95931C1E6DE2E900D5B294 /* MGLNSDateAdditionsTests.mm */, DAE7DEC11E245455007505A6 /* MGLNSStringAdditionsTests.m */, DA2E885D1CC0382C00F24E7B /* MGLOfflinePackTests.m */, DA2E885E1CC0382C00F24E7B /* MGLOfflineRegionTests.m */, @@ -2099,7 +2099,7 @@ 40CFA6511D7875BB008103BD /* MGLShapeSourceTests.mm in Sources */, DA35A2C51CCA9F8300E826B2 /* MGLClockDirectionFormatterTests.m in Sources */, 35B8E08C1D6C8B5100E768D2 /* MGLPredicateTests.mm in Sources */, - 1F131E341E6A35EC0055AF5B /* MGLNSDateAdditionsTests.mm in Sources */, + 1F95931D1E6DE2E900D5B294 /* MGLNSDateAdditionsTests.mm in Sources */, DD58A4C61D822BD000E1F038 /* MGLExpressionTests.mm in Sources */, 3575798B1D502B0C000B822E /* MGLBackgroundStyleLayerTests.mm in Sources */, DA2E88621CC0382C00F24E7B /* MGLOfflinePackTests.m in Sources */, diff --git a/platform/ios/test/MGLNSDateAdditionsTests.mm b/platform/ios/test/MGLNSDateAdditionsTests.mm deleted file mode 100644 index 474fe763ff..0000000000 --- a/platform/ios/test/MGLNSDateAdditionsTests.mm +++ /dev/null @@ -1,26 +0,0 @@ -#import - -#include -#import "../../darwin/src/NSDate+MGLAdditions.h" - -using namespace std::chrono_literals; - -@interface MGLNSDateAdditionsTests : XCTestCase -@end - -@implementation MGLNSDateAdditionsTests - -- (void)testDurationToNSTimeInterval { - - NSTimeInterval timeInterval = 5; - mbgl::Duration duration = MGLDurationFromTimeInterval(timeInterval); - NSTimeInterval durationTimeInterval = MGLTimeIntervalFromDuration(duration); - - mbgl::Duration expectedDuration = 5s; - - XCTAssertEqual(timeInterval, durationTimeInterval); - XCTAssertEqual(timeInterval, MGLTimeIntervalFromDuration(expectedDuration)); - -} - -@end diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj index d76a225edb..4a2cc0e71a 100644 --- a/platform/macos/macos.xcodeproj/project.pbxproj +++ b/platform/macos/macos.xcodeproj/project.pbxproj @@ -8,7 +8,7 @@ /* Begin PBXBuildFile section */ 1753ED401E53CE6100A9FD90 /* MGLConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1753ED3F1E53CE5200A9FD90 /* MGLConversion.h */; }; - 1F131E361E6A36170055AF5B /* MGLNSDateAdditionsTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F131E351E6A36170055AF5B /* MGLNSDateAdditionsTests.mm */; }; + 1F95931B1E6DE2B600D5B294 /* MGLNSDateAdditionsTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F95931A1E6DE2B600D5B294 /* MGLNSDateAdditionsTests.mm */; }; 30E5781B1DAA857E0050F07E /* NSImage+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E578141DAA7D920050F07E /* NSImage+MGLAdditions.h */; }; 3508EC641D749D39009B0EE4 /* NSExpression+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3508EC621D749D39009B0EE4 /* NSExpression+MGLAdditions.h */; }; 3508EC651D749D39009B0EE4 /* NSExpression+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3508EC631D749D39009B0EE4 /* NSExpression+MGLAdditions.mm */; }; @@ -264,7 +264,7 @@ /* Begin PBXFileReference section */ 1753ED3F1E53CE5200A9FD90 /* MGLConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLConversion.h; sourceTree = ""; }; - 1F131E351E6A36170055AF5B /* MGLNSDateAdditionsTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLNSDateAdditionsTests.mm; sourceTree = ""; }; + 1F95931A1E6DE2B600D5B294 /* MGLNSDateAdditionsTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLNSDateAdditionsTests.mm; path = ../../darwin/test/MGLNSDateAdditionsTests.mm; sourceTree = ""; }; 30E578141DAA7D920050F07E /* NSImage+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSImage+MGLAdditions.h"; path = "src/NSImage+MGLAdditions.h"; sourceTree = SOURCE_ROOT; }; 3508EC621D749D39009B0EE4 /* NSExpression+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSExpression+MGLAdditions.h"; sourceTree = ""; }; 3508EC631D749D39009B0EE4 /* NSExpression+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSExpression+MGLAdditions.mm"; sourceTree = ""; }; @@ -959,8 +959,8 @@ DA35A2A71CC9F41600E826B2 /* MGLCoordinateFormatterTests.m */, DA2987591E1A4290002299F5 /* MGLDocumentationExampleTests.swift */, DD58A4C71D822C6200E1F038 /* MGLExpressionTests.mm */, - 1F131E351E6A36170055AF5B /* MGLNSDateAdditionsTests.mm */, 35C6DF861E214C1800ACA483 /* MGLDistanceFormatterTests.m */, + 1F95931A1E6DE2B600D5B294 /* MGLNSDateAdditionsTests.mm */, DA0CD58D1CF56F5800A5F5A5 /* MGLFeatureTests.mm */, DAE6C3C81CC34BD800DB3429 /* MGLGeometryTests.mm */, DAE7DEC31E24549F007505A6 /* MGLNSStringAdditionsTests.m */, @@ -1423,7 +1423,7 @@ DAE6C3D21CC34C9900DB3429 /* MGLGeometryTests.mm in Sources */, DA87A9A41DCACC5000810D09 /* MGLSymbolStyleLayerTests.mm in Sources */, 40E1601D1DF217D6005EA6D9 /* MGLStyleLayerTests.m in Sources */, - 1F131E361E6A36170055AF5B /* MGLNSDateAdditionsTests.mm in Sources */, + 1F95931B1E6DE2B600D5B294 /* MGLNSDateAdditionsTests.mm in Sources */, DA87A9A61DCACC5000810D09 /* MGLCircleStyleLayerTests.mm in Sources */, DA87A99E1DC9DC2100810D09 /* MGLPredicateTests.mm in Sources */, DD58A4C91D822C6700E1F038 /* MGLExpressionTests.mm in Sources */, diff --git a/platform/macos/test/MGLNSDateAdditionsTests.mm b/platform/macos/test/MGLNSDateAdditionsTests.mm deleted file mode 100644 index 474fe763ff..0000000000 --- a/platform/macos/test/MGLNSDateAdditionsTests.mm +++ /dev/null @@ -1,26 +0,0 @@ -#import - -#include -#import "../../darwin/src/NSDate+MGLAdditions.h" - -using namespace std::chrono_literals; - -@interface MGLNSDateAdditionsTests : XCTestCase -@end - -@implementation MGLNSDateAdditionsTests - -- (void)testDurationToNSTimeInterval { - - NSTimeInterval timeInterval = 5; - mbgl::Duration duration = MGLDurationFromTimeInterval(timeInterval); - NSTimeInterval durationTimeInterval = MGLTimeIntervalFromDuration(duration); - - mbgl::Duration expectedDuration = 5s; - - XCTAssertEqual(timeInterval, durationTimeInterval); - XCTAssertEqual(timeInterval, MGLTimeIntervalFromDuration(expectedDuration)); - -} - -@end -- cgit v1.2.1 From e115d55ef6b960153ba40aba297b00608f3f3baf Mon Sep 17 00:00:00 2001 From: Tobrun Date: Wed, 8 Mar 2017 15:01:15 -0800 Subject: MyLocationView activate/deactivate LocationSource (#8255) * [android] - activate/deactivate the locationSource when toggling the MyLocationView state. * correct accuracy width --- .../java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'platform') diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java index 2c3685b862..94d4ca2db2 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java @@ -257,9 +257,7 @@ public class MyLocationView extends View { final PointF pointF = screenLocation; float metersPerPixel = (float) projection.getMetersPerPixelAtLatitude(location.getLatitude()); - float accuracyPixels = (Float) accuracyAnimator.getAnimatedValue() / metersPerPixel / 2; - float maxRadius = getWidth() / 2; - accuracyPixels = accuracyPixels <= maxRadius ? accuracyPixels : maxRadius; + float accuracyPixels = (Float) accuracyAnimator.getAnimatedValue() / metersPerPixel; // reset matrix.reset(); @@ -435,10 +433,12 @@ public class MyLocationView extends View { } locationEngine.addLocationEngineListener(userLocationListener); + locationEngine.activate(); } else { // Disable location and user dot location = null; locationEngine.removeLocationEngineListener(userLocationListener); + locationEngine.deactivate(); } locationEngine.setPriority(LocationEnginePriority.HIGH_ACCURACY); @@ -730,7 +730,7 @@ public class MyLocationView extends View { accuracyAnimator.end(); } - accuracyAnimator = ValueAnimator.ofFloat(accuracy * 10, location.getAccuracy() * 10); + accuracyAnimator = ValueAnimator.ofFloat(accuracy, location.getAccuracy()); accuracyAnimator.setDuration(750); accuracyAnimator.start(); accuracy = location.getAccuracy(); -- cgit v1.2.1 From c9f63baccd60250fda174806144a605c95b58a1b Mon Sep 17 00:00:00 2001 From: Tobrun Date: Thu, 9 Mar 2017 12:26:48 -0800 Subject: [android] - build aar once (#8297) --- platform/android/bitrise.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'platform') diff --git a/platform/android/bitrise.yml b/platform/android/bitrise.yml index aadcba79be..de1095409e 100644 --- a/platform/android/bitrise.yml +++ b/platform/android/bitrise.yml @@ -181,10 +181,8 @@ workflows: inputs: - content: |- #!/bin/bash - echo "Compile libmapbox-gl.so for all supportd abi's:" - export BUILDTYPE=Release - make apackage - cd platform/android && ./gradlew :MapboxGLAndroidSDK:assembleRelease + echo "Compile libmapbox-gl.so for all supported abi's and create an aar file:" + BUILDTYPE=Release make apackage - script: title: Publish to maven inputs: -- cgit v1.2.1 From db3ffb9a2a80ba16206542f833bfeef52d66cec6 Mon Sep 17 00:00:00 2001 From: Antonio Zugaldia Date: Thu, 9 Mar 2017 11:36:32 -0800 Subject: [android] bump versions to beta.3 --- platform/android/dependencies.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'platform') diff --git a/platform/android/dependencies.gradle b/platform/android/dependencies.gradle index 3eb28452c6..8f9fa386e6 100644 --- a/platform/android/dependencies.gradle +++ b/platform/android/dependencies.gradle @@ -16,9 +16,9 @@ ext { dep = [ // mapbox - mapboxJavaServices : 'com.mapbox.mapboxsdk:mapbox-java-services:2.0.0-beta.2@jar', - mapboxJavaGeoJSON : 'com.mapbox.mapboxsdk:mapbox-java-geojson:2.0.0-beta.2@jar', - mapboxAndroidTelemetry : 'com.mapbox.mapboxsdk:mapbox-android-telemetry:2.0.0-beta.2@aar', + mapboxJavaServices : 'com.mapbox.mapboxsdk:mapbox-java-services:2.0.0-beta.3@jar', + mapboxJavaGeoJSON : 'com.mapbox.mapboxsdk:mapbox-java-geojson:2.0.0-beta.3@jar', + mapboxAndroidTelemetry : 'com.mapbox.mapboxsdk:mapbox-android-telemetry:2.0.0-beta.3@aar', // mapzen lost lost : 'com.mapzen.android:lost:2.1.2', -- cgit v1.2.1 From 9f42383d8a49374e12dc10d5236daf5c0c7f85b5 Mon Sep 17 00:00:00 2001 From: Antonio Zugaldia Date: Thu, 9 Mar 2017 11:37:01 -0800 Subject: [android] re-add build config fields --- platform/android/MapboxGLAndroidSDK/build.gradle | 2 ++ 1 file changed, 2 insertions(+) (limited to 'platform') diff --git a/platform/android/MapboxGLAndroidSDK/build.gradle b/platform/android/MapboxGLAndroidSDK/build.gradle index 6602d919a3..2ce3780421 100644 --- a/platform/android/MapboxGLAndroidSDK/build.gradle +++ b/platform/android/MapboxGLAndroidSDK/build.gradle @@ -27,6 +27,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion buildConfigField "String", "GIT_REVISION_SHORT", String.format("\"%s\"", getGitRevision()) + buildConfigField "String", "MAPBOX_VERSION_STRING", String.format("\"Mapbox/%s\"", project.VERSION_NAME) + buildConfigField "String", "MAPBOX_EVENTS_USER_AGENT", String.format("\"MapboxEventsAndroid/%s\"", project.VERSION_NAME) } // avoid naming conflicts, force usage of prefix -- cgit v1.2.1 From 4ca65b9701985e53baff16daaabb74e5a27882e3 Mon Sep 17 00:00:00 2001 From: Antonio Zugaldia Date: Thu, 9 Mar 2017 11:37:36 -0800 Subject: [android] set user agent on initialization --- .../MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform') diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java index 296d93d0ca..ea8a861ae1 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java @@ -37,7 +37,7 @@ public final class Mapbox { INSTANCE = new Mapbox(appContext, accessToken); LocationEngine locationEngine = new LocationSource(appContext); locationEngine.setPriority(LocationEnginePriority.NO_POWER); - MapboxTelemetry.getInstance().initialize(appContext, accessToken, locationEngine); + MapboxTelemetry.getInstance().initialize(appContext, accessToken, BuildConfig.MAPBOX_EVENTS_USER_AGENT, locationEngine); ConnectivityReceiver.instance(appContext); } return INSTANCE; -- cgit v1.2.1 From c533b7077dc2d9539af0051a8c50e01e2e80b048 Mon Sep 17 00:00:00 2001 From: Antonio Zugaldia Date: Thu, 9 Mar 2017 11:37:56 -0800 Subject: [android] update version to local package build config --- .../src/main/java/com/mapbox/mapboxsdk/http/HTTPRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform') diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HTTPRequest.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HTTPRequest.java index cedc5fe46c..9c8cda5544 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HTTPRequest.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HTTPRequest.java @@ -183,7 +183,7 @@ class HTTPRequest implements Callback { return USER_AGENT_STRING = Util.toHumanReadableAscii( String.format("%s %s (%s) Android/%s (%s)", getApplicationIdentifier(), - com.mapbox.services.android.telemetry.BuildConfig.MAPBOX_VERSION_STRING, + BuildConfig.MAPBOX_VERSION_STRING, BuildConfig.GIT_REVISION_SHORT, Build.VERSION.SDK_INT, Build.CPU_ABI) -- cgit v1.2.1 From 495d73d187390316080e3c5a617ad9851ba27751 Mon Sep 17 00:00:00 2001 From: Antonio Zugaldia Date: Thu, 9 Mar 2017 11:54:26 -0800 Subject: [android] fix checkstyle --- .../MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'platform') diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java index ea8a861ae1..63b8e40fa0 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java @@ -37,7 +37,8 @@ public final class Mapbox { INSTANCE = new Mapbox(appContext, accessToken); LocationEngine locationEngine = new LocationSource(appContext); locationEngine.setPriority(LocationEnginePriority.NO_POWER); - MapboxTelemetry.getInstance().initialize(appContext, accessToken, BuildConfig.MAPBOX_EVENTS_USER_AGENT, locationEngine); + MapboxTelemetry.getInstance().initialize( + appContext, accessToken, BuildConfig.MAPBOX_EVENTS_USER_AGENT, locationEngine); ConnectivityReceiver.instance(appContext); } return INSTANCE; -- cgit v1.2.1 From b8283e838ecd98003b0580f036e52fab2cf2c3d7 Mon Sep 17 00:00:00 2001 From: Antonio Zugaldia Date: Thu, 9 Mar 2017 12:08:27 -0800 Subject: [android] renames MultiPoint to BasePointCollection --- .../mapboxsdk/annotations/BasePointCollection.java | 71 ++++++++++++++++++++++ .../mapbox/mapboxsdk/annotations/MultiPoint.java | 71 ---------------------- .../com/mapbox/mapboxsdk/annotations/Polygon.java | 2 +- .../com/mapbox/mapboxsdk/annotations/Polyline.java | 2 +- 4 files changed, 73 insertions(+), 73 deletions(-) create mode 100644 platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BasePointCollection.java delete mode 100644 platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MultiPoint.java (limited to 'platform') diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BasePointCollection.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BasePointCollection.java new file mode 100644 index 0000000000..e57821b541 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BasePointCollection.java @@ -0,0 +1,71 @@ +package com.mapbox.mapboxsdk.annotations; + +import com.mapbox.mapboxsdk.geometry.LatLng; + +import java.util.ArrayList; +import java.util.List; + +/** + * Multipoint is an abstract annotation for combining geographical locations. + */ +public abstract class BasePointCollection extends Annotation { + + private List points; + private float alpha = 1.0f; + + protected BasePointCollection() { + super(); + points = new ArrayList<>(); + } + + /** + * Returns a copy of the points. + * + * @return A {@link List} of points. + */ + public List getPoints() { + return new ArrayList<>(points); + } + + /** + * Sets the points of this polyline. This method will take a copy of the points, so further + * mutations to points will have no effect on this polyline. + * + * @param points A {@link List} of {@link LatLng} points making up the polyline. + */ + public void setPoints(List points) { + this.points = new ArrayList<>(points); + update(); + } + + /** + * Add a point to the polyline. + * + * @param point A {@link LatLng} point to be added. + */ + public void addPoint(LatLng point) { + points.add(point); + update(); + } + + /** + * Value between 0 and 1 defining the polyline alpha. + * + * @return float value between 0 and 1. + */ + public float getAlpha() { + return alpha; + } + + /** + * Set this {@link BasePointCollection}s alpha. + * + * @param alpha float value between 0 and 1. + */ + public void setAlpha(float alpha) { + this.alpha = alpha; + update(); + } + + abstract void update(); +} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MultiPoint.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MultiPoint.java deleted file mode 100644 index 2bd3c82786..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MultiPoint.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.mapbox.mapboxsdk.annotations; - -import com.mapbox.mapboxsdk.geometry.LatLng; - -import java.util.ArrayList; -import java.util.List; - -/** - * Multipoint is an abstract annotation for combining geographical locations. - */ -public abstract class MultiPoint extends Annotation { - - private List points; - private float alpha = 1.0f; - - protected MultiPoint() { - super(); - points = new ArrayList<>(); - } - - /** - * Returns a copy of the points. - * - * @return A {@link List} of points. - */ - public List getPoints() { - return new ArrayList<>(points); - } - - /** - * Sets the points of this polyline. This method will take a copy of the points, so further - * mutations to points will have no effect on this polyline. - * - * @param points A {@link List} of {@link LatLng} points making up the polyline. - */ - public void setPoints(List points) { - this.points = new ArrayList<>(points); - update(); - } - - /** - * Add a point to the polyline. - * - * @param point A {@link LatLng} point to be added. - */ - public void addPoint(LatLng point) { - points.add(point); - update(); - } - - /** - * Value between 0 and 1 defining the polyline alpha. - * - * @return float value between 0 and 1. - */ - public float getAlpha() { - return alpha; - } - - /** - * Set this {@link MultiPoint}s alpha. - * - * @param alpha float value between 0 and 1. - */ - public void setAlpha(float alpha) { - this.alpha = alpha; - update(); - } - - abstract void update(); -} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Polygon.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Polygon.java index 7b9de86bc4..4a72cb7d89 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Polygon.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Polygon.java @@ -7,7 +7,7 @@ import com.mapbox.mapboxsdk.maps.MapboxMap; /** * Polygon is a geometry annotation that's a closed loop of coordinates. */ -public final class Polygon extends MultiPoint { +public final class Polygon extends BasePointCollection { private int fillColor = Color.BLACK; // default fillColor is black private int strokeColor = Color.BLACK; // default strokeColor is black diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Polyline.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Polyline.java index a430d11009..6cea29ef81 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Polyline.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Polyline.java @@ -7,7 +7,7 @@ import com.mapbox.mapboxsdk.maps.MapboxMap; /** * Polyline is a geometry feature with an unclosed list of coordinates drawn as a line */ -public final class Polyline extends MultiPoint { +public final class Polyline extends BasePointCollection { private int color = Color.BLACK; // default color is black private float width = 10; // As specified by Google API Docs (in pixels) -- cgit v1.2.1 From 1693b389d7d17315b8a2a9bdd862207ace053f77 Mon Sep 17 00:00:00 2001 From: Tobrun Date: Thu, 9 Mar 2017 16:59:10 -0800 Subject: [android] - move touch handling of MarkerViews back to View#setOnClickListener. Workaround panning issue by dispatching touch events to the parent ViewGroup. (#8272) --- .../mapboxsdk/annotations/MarkerViewContainer.java | 30 +++++++++++++++ .../mapboxsdk/annotations/MarkerViewManager.java | 43 ++++++++-------------- .../mapbox/mapboxsdk/maps/AnnotationManager.java | 17 ++++----- .../com/mapbox/mapboxsdk/maps/IconManager.java | 21 ----------- .../main/res/layout/mapbox_mapview_internal.xml | 2 +- 5 files changed, 53 insertions(+), 60 deletions(-) create mode 100644 platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewContainer.java (limited to 'platform') diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewContainer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewContainer.java new file mode 100644 index 0000000000..1f206b71ca --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewContainer.java @@ -0,0 +1,30 @@ +package com.mapbox.mapboxsdk.annotations; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.MotionEvent; +import android.view.ViewGroup; +import android.widget.FrameLayout; + +/** + * ViewGroup that dispatches TouchEvents to the parent ViewGroup. + *

+ * This allows to dispatch touch events that occur on MarkerView to MapView. + * https://github.com/mapbox/mapbox-gl-native/issues/5388 + *

+ */ +public class MarkerViewContainer extends FrameLayout { + + public MarkerViewContainer(Context context, AttributeSet attrs) { + super(context, attrs); + } + + @Override + public boolean dispatchTouchEvent(MotionEvent ev) { + final boolean childResult = super.dispatchTouchEvent(ev); + if (childResult) { + ((ViewGroup) getParent()).onTouchEvent(ev); + } + return childResult; + } +} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java index 315e12d280..9a721151f7 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java @@ -503,6 +503,21 @@ public class MarkerViewManager implements MapView.OnMapChangedListener { } } + adaptedView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(final View v) { + boolean clickHandled = false; + if (onMarkerViewClickListener != null) { + clickHandled = onMarkerViewClickListener.onMarkerClick(marker, v, adapter); + } + + if (!clickHandled) { + ensureInfoWindowOffset(marker); + select(marker, v, adapter); + } + } + }); + marker.setMapboxMap(mapboxMap); markerViewMap.put(marker, adaptedView); if (convertView == null) { @@ -530,34 +545,6 @@ public class MarkerViewManager implements MapView.OnMapChangedListener { updateMarkerViewsPosition(); } - /** - * When the provided {@link MarkerView} is clicked on by a user, we check if a custom click - * event has been created and if not, display a {@link InfoWindow}. - * - * @param markerView that the click event occurred. - */ - public boolean onClickMarkerView(MarkerView markerView) { - boolean clickHandled = false; - - MapboxMap.MarkerViewAdapter adapter = getViewAdapter(markerView); - View view = getView(markerView); - if (adapter == null || view == null) { - // not a valid state - return true; - } - - if (onMarkerViewClickListener != null) { - clickHandled = onMarkerViewClickListener.onMarkerClick(markerView, view, adapter); - } - - if (!clickHandled) { - ensureInfoWindowOffset(markerView); - select(markerView, view, adapter); - } - - return clickHandled; - } - /** * Handles the {@link MarkerView}'s info window offset. * diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java index 0c77723354..e91779dfd1 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java @@ -10,6 +10,7 @@ import com.mapbox.mapboxsdk.annotations.Annotation; import com.mapbox.mapboxsdk.annotations.BaseMarkerOptions; import com.mapbox.mapboxsdk.annotations.BaseMarkerViewOptions; import com.mapbox.mapboxsdk.annotations.Icon; +import com.mapbox.mapboxsdk.annotations.IconFactory; import com.mapbox.mapboxsdk.annotations.Marker; import com.mapbox.mapboxsdk.annotations.MarkerView; import com.mapbox.mapboxsdk.annotations.MarkerViewManager; @@ -256,7 +257,11 @@ class AnnotationManager { private MarkerView prepareViewMarker(BaseMarkerViewOptions markerViewOptions) { MarkerView marker = markerViewOptions.getMarker(); - iconManager.loadIconForMarkerView(marker); + Icon icon = markerViewOptions.getIcon(); + if (icon == null) { + icon = IconFactory.getInstance(mapView.getContext()).defaultMarkerView(); + } + marker.setIcon(icon); return marker; } @@ -660,24 +665,16 @@ class AnnotationManager { if (annotation.getId() == newSelectedMarkerId) { Marker marker = (Marker) annotation; - if (marker instanceof MarkerView) { - handledDefaultClick = markerViewManager.onClickMarkerView((MarkerView) marker); - } else { + if (!(marker instanceof MarkerView)) { if (onMarkerClickListener != null) { // end developer has provided a custom click listener handledDefaultClick = onMarkerClickListener.onMarkerClick(marker); } - } - - if (annotation instanceof MarkerView) { - markerViewManager.onClickMarkerView((MarkerView) annotation); - } else { if (!handledDefaultClick) { // only select marker if user didn't handle the click event themselves selectMarker(marker); } } - return true; } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/IconManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/IconManager.java index c9d81a88bc..c152630278 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/IconManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/IconManager.java @@ -71,27 +71,6 @@ class IconManager { return icon; } - Icon loadIconForMarkerView(MarkerView marker) { - Icon icon = marker.getIcon(); - int iconSize = icons.size() + 1; - if (icon == null) { - icon = IconFactory.getInstance(nativeMapView.getContext()).defaultMarkerView(); - marker.setIcon(icon); - } - Bitmap bitmap = icon.getBitmap(); - averageIconHeight = averageIconHeight + (bitmap.getHeight() - averageIconHeight) / iconSize; - averageIconWidth = averageIconWidth + (bitmap.getWidth() - averageIconWidth) / iconSize; - if (!icons.contains(icon)) { - icons.add(icon); - } else { - Icon oldIcon = icons.get(icons.indexOf(icon)); - if (!oldIcon.getBitmap().sameAs(icon.getBitmap())) { - throw new IconBitmapChangedException(); - } - } - return icon; - } - int getTopOffsetPixelsForIcon(Icon icon) { return (int) (nativeMapView.getTopOffsetPixelsForAnnotationSymbol(icon.getId()) * nativeMapView.getPixelRatio()); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/res/layout/mapbox_mapview_internal.xml b/platform/android/MapboxGLAndroidSDK/src/main/res/layout/mapbox_mapview_internal.xml index e6a2677785..7a38437fee 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/res/layout/mapbox_mapview_internal.xml +++ b/platform/android/MapboxGLAndroidSDK/src/main/res/layout/mapbox_mapview_internal.xml @@ -8,7 +8,7 @@ android:contentDescription="@null" android:visibility="gone"/> - Date: Thu, 9 Mar 2017 17:20:44 -0800 Subject: [android] - harden mapZoomButtonController to avoid null pointer exceptions (#8332) --- .../src/main/java/com/mapbox/mapboxsdk/maps/MapView.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'platform') diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java index 8fa2d0b152..ac6c15f671 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java @@ -521,13 +521,15 @@ public class MapView extends FrameLayout { @CallSuper protected void onDetachedFromWindow() { super.onDetachedFromWindow(); - mapZoomButtonController.setVisible(false); + if (mapZoomButtonController != null) { + mapZoomButtonController.setVisible(false); + } } // Called when view is hidden and shown @Override protected void onVisibilityChanged(@NonNull View changedView, int visibility) { - if (isInEditMode()) { + if (isInEditMode() || mapZoomButtonController == null) { return; } mapZoomButtonController.setVisible(visibility == View.VISIBLE); -- cgit v1.2.1 From d1e50b3ab837e6dcb4153fee141b9b15e97a6872 Mon Sep 17 00:00:00 2001 From: Tobrun Date: Thu, 9 Mar 2017 17:20:56 -0800 Subject: [android] - add style loading callback (#8291) * [android] - add style loading callback that is invoked when a style finishes loading. * fixup language + add support for adding a callback when invoking setStyle with the default styles. --- .../java/com/mapbox/mapboxsdk/maps/MapboxMap.java | 98 ++++++++++++++++++---- .../activity/camera/MaxMinZoomActivity.java | 18 +++- .../activity/maplayout/DebugModeActivity.java | 7 +- 3 files changed, 106 insertions(+), 17 deletions(-) (limited to 'platform') diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java index 46c5e269c0..2af2c2ef0f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java @@ -881,35 +881,80 @@ public final class MapboxMap { /** *

- * Loads a new map style from the specified URL. + * Loads a new map style asynchronous from the specified URL. *

* {@code url} can take the following forms: *
    *
  • {@code Style.*}: load one of the bundled styles in {@link Style}.
  • *
  • {@code mapbox://styles//