From 17b3ec1edd217b8b14d64b74cbf58b0e4ae4f241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Thu, 5 Jan 2017 03:22:04 -0800 Subject: [ios, macos] Renamed text-field, text-font, text-font-size, circle-pitch-scale Reduced the likelihood that the developer might attempt to set textField to an NSTextField or UITextField, or textFont to an NSFont or UIFont, or textSize to a CGSize or NSSize, or circlePitchScale to a number (given iconScale). --- platform/macos/app/MapDocument.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'platform/macos/app/MapDocument.m') diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m index f00f773bf9..8554772af3 100644 --- a/platform/macos/app/MapDocument.m +++ b/platform/macos/app/MapDocument.m @@ -369,18 +369,18 @@ NS_ARRAY_OF(id ) *MBXFlattenedShapes(NS_ARRAY_OF(id *)layer.textField rawValue]; - layer.textField = [MGLStyleValue valueWithRawValue:stringByLocalizingString(textField)]; - } else if ([layer.textField isKindOfClass:[MGLStyleFunction class]]) { - MGLStyleFunction *function = (MGLStyleFunction *)layer.textField; + if ([layer.text isKindOfClass:[MGLStyleConstantValue class]]) { + NSString *textField = [(MGLStyleConstantValue *)layer.text rawValue]; + layer.text = [MGLStyleValue valueWithRawValue:stringByLocalizingString(textField)]; + } else if ([layer.text isKindOfClass:[MGLStyleFunction class]]) { + MGLStyleFunction *function = (MGLStyleFunction *)layer.text; NSMutableDictionary *stops = function.stops.mutableCopy; [stops enumerateKeysAndObjectsUsingBlock:^(NSNumber *zoomLevel, MGLStyleConstantValue *stop, BOOL *done) { NSString *textField = stop.rawValue; stops[zoomLevel] = [MGLStyleValue valueWithRawValue:stringByLocalizingString(textField)]; }]; function.stops = stops; - layer.textField = function; + layer.text = function; } } } -- cgit v1.2.1