From 04c70f55a534ca7cb4bb5358da3217329643a0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Sat, 8 Dec 2018 01:43:35 -0800 Subject: [ios] Announce POI categories where available --- platform/ios/src/MGLMapAccessibilityElement.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'platform') diff --git a/platform/ios/src/MGLMapAccessibilityElement.mm b/platform/ios/src/MGLMapAccessibilityElement.mm index c1cc5304d7..240eab1545 100644 --- a/platform/ios/src/MGLMapAccessibilityElement.mm +++ b/platform/ios/src/MGLMapAccessibilityElement.mm @@ -78,7 +78,11 @@ NSMutableArray *facts = [NSMutableArray array]; // Announce the kind of place or POI. - if (attributes[@"type"]) { + NSString *languageCode = [MGLVectorTileSource preferredMapboxStreetsLanguage]; + NSString *categoryAttribute = [NSString stringWithFormat:@"category_%@", languageCode]; + if (attributes[categoryAttribute]) { + [facts addObject:attributes[categoryAttribute]]; + } else if (attributes[@"type"]) { // FIXME: Unfortunately, these types aren’t a closed set that can be // localized, since they’re based on OpenStreetMap tags. NSString *type = [attributes[@"type"] stringByReplacingOccurrencesOfString:@"_" @@ -88,7 +92,6 @@ // Announce the kind of airport, rail station, or mountain based on its // Maki image name. else if (attributes[@"maki"]) { - // TODO: Localize Maki image names. [facts addObject:attributes[@"maki"]]; } -- cgit v1.2.1