-
Notifications
You must be signed in to change notification settings - Fork 320
Description
mapbox/mapbox-gl-native#13481 adds support for Mapbox Streets source v8, which is currently in beta. By the time map SDK v7.0.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.
As far as I can tell, here are the changes we’ll need to make to accommodate both v7 and v8:
- Add Streets source v8 instead of v7:
Line 69 in 4ab858b
private static final String MAPBOX_STREETS_V7 = "mapbox://mapbox.mapbox-streets-v7"; - Check if Streets source v8 is already part of the style, if so don't add:
Lines 601 to 602 in 4ab858b
VectorSource streetSource = new VectorSource(STREETS_SOURCE_ID, MAPBOX_STREETS_V7); mapboxMap.addSource(streetSource); - If Streets source v7 is already part of the style, add v7 instead:
Lines 601 to 602 in 4ab858b
VectorSource streetSource = new VectorSource(STREETS_SOURCE_ID, MAPBOX_STREETS_V7); mapboxMap.addSource(streetSource); - Use the
roadlayer instead ofroad_labelwhen the style contains Streets source v8:Line 71 in 4ab858b
private static final String ROAD_LABEL = "road_label";
Unlike in mapbox/mapbox-navigation-ios#1896, it looks like the Android navigation SDK always adds a vector tile source for Streets source v8, without checking whether Streets source is already part of the style. That’s a problem because the SDK would end up downloading tiles for two different versions of the Streets source simultaneously, significantly increasing bandwidth consuption.
Does the Android navigation SDK automatically localize labels like on iOS? If so, there may need to be some changes to account for different language fallback mechanisms between v7 and v8.
/cc @mapbox/navigation-android @mapbox/maps-android @brsbl @taraniduncan