-
Notifications
You must be signed in to change notification settings - Fork 326
Description
mapbox/mapbox-gl-native#13481 adds support for Mapbox Streets source v8, which is currently in beta. By the time map SDK v4.7.0 comes out, we’ll need to add corresponding support for Streets source v8; otherwise, anyone using a v8-dependent style will incur twice as much overhead from vector tile downloading and processing, while map labels and the current road name label will go blank. We’ll want to retain support for v7 for the time being, since some popular navigation styles still use v7.
Here are the changes we’ll need to make to accommodate both v7 and v8:
- Detect Streets source v8:
return configurationURL.scheme == "mapbox" && configurationURL.host!.components(separatedBy: ",").contains("mapbox.mapbox-streets-v7") - Add Streets source v8 instead of v7 when Streets source is missing from the style:
mapbox-navigation-ios/MapboxNavigation/RouteMapViewController.swift
Lines 777 to 782 in 6bc02c3
// Add Mapbox Streets if the map does not already have it if streetsSources.isEmpty { let source = MGLVectorTileSource(identifier: "mapboxStreetsv7", configurationURL: URL(string: "mapbox://mapbox.mapbox-streets-v7")!) style.addSource(source) streetsSources.append(source) } - Use the
roadlayer instead ofroad_labelwhen the style contains Streets source v8:mapbox-navigation-ios/MapboxNavigation/NavigationMapView.swift
Lines 1004 to 1005 in 6bc02c3
// Road labels should match road signage. let locale = layer.sourceLayerIdentifier == "road_label" ? Locale(identifier: "mul") : nil streetLabelLayer.sourceLayerIdentifier = "road_label"
/cc @mapbox/navigation-ios @mapbox/maps-ios @brsbl