diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-12-08 01:43:35 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2018-12-08 02:18:56 -0800 |
commit | 04c70f55a534ca7cb4bb5358da3217329643a0f0 (patch) | |
tree | 063881eaf4e0ddf6915d07b3df81a2e54ca2d17e /platform | |
parent | 3dffb1fd5354829de6c4e6f39d016c389142f92e (diff) | |
download | qtlocation-mapboxgl-04c70f55a534ca7cb4bb5358da3217329643a0f0.tar.gz |
[ios] Announce POI categories where available
Diffstat (limited to 'platform')
-rw-r--r-- | platform/ios/src/MGLMapAccessibilityElement.mm | 7 |
1 files changed, 5 insertions, 2 deletions
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"]]; } |