From afd4df9dbcdff08654a09e95fdae236061aaa4bd Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Tue, 1 Aug 2017 16:14:41 -0400 Subject: =?UTF-8?q?[ios]=20adapt=20Mapbox=20Streets=E2=80=93sourced=20laye?= =?UTF-8?q?rs=20for=20user=20preferred=20language=20(#9582)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [ios] Update label localization * [ios, macos] Move MGLVectorSource+MBXAdditions.h to darwin. * [ios, macos] Adapt Mapbox Streets to the user preferred language. * [ios, macos] Clarify style localization documentation. * [ios, macos] Update localization examples * [ios, macos] Add style language reset to original. * [ios, macos] Update changelogs. * [ios, macos] Rename Vector Source Additions to MGL standard. * [ios, macos] Add suport for stop localization. --- platform/macos/app/MapDocument.m | 49 ++-------------------------------------- 1 file changed, 2 insertions(+), 47 deletions(-) (limited to 'platform/macos/app/MapDocument.m') diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m index 59844d363e..1d22295f50 100644 --- a/platform/macos/app/MapDocument.m +++ b/platform/macos/app/MapDocument.m @@ -5,7 +5,7 @@ #import "DroppedPinAnnotation.h" #import "MGLStyle+MBXAdditions.h" -#import "MGLVectorSource+MBXAdditions.h" +#import "MGLVectorSource+MGLAdditions.h" #import @@ -344,52 +344,7 @@ NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id *)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, MGLConstantStyleValue *stop, BOOL *done) { - NSString *textField = stop.rawValue; - stops[zoomLevel] = [MGLStyleValue valueWithRawValue:stringByLocalizingString(textField)]; - }]; - function.stops = stops; - layer.text = function; - } - } + self.mapView.style.localizesLabels = _isLocalizingLabels; } - (void)applyPendingState { -- cgit v1.2.1