I have been creating maps in minority languages by adding custom layers with GeoJSON sources and hiding/removing some label layers supplied by the style I'm using.
After upgrading from Mapbox GL JS 0.26.0 to 0.28.0, some layers do no longer show up on my map. These problems also occur when using 0.27.0, but do not happen when going back 0.26.0.
Not all layers are concerned, it's basically only "place labels" that are no longer being shown. Below is an example of a layer that stopped working after upgrading. I haven't changed anything on the actual layer code and the source I've been using is the same.
map.addLayer({
"id": "localizedCityNames",
"type": "symbol",
"metadata": {
"mapbox:group": "1444849272561.29"
},
"source": source,
"source-layer": "place_label",
"filter": [
"==",
"place",
"city"
],
"layout": {
"text-font": [
"Open Sans Semibold",
"Arial Unicode MS Bold"
],
"text-field": "{name:"+language+"}",
"text-max-width": 8,
"text-size": {
"base": 1.2,
"stops": [
[
7,
14
],
[
11,
24
]
]
}
},
"paint": {
"text-color": "#333",
"text-halo-color": "rgba(255,255,255,0.8)",
"text-halo-width": 1.2
}
});
To your information, I've been using Mapbox Bright style and the layer I pasted above is almost identical to the default 'place_label_city' one.
Does anyone know why this layer doesn't show up anymore?
Can you please set up a minimal JSFiddle that demonstrates the issue?
Having an issue that seems related. My layer also works fine in 0.26.0, but does not show in 0.27.0.
myMap.on('load', function () {
myMap.addSource('markers', {
'type': 'geojson',
'data': markergeojson
})
myMap.addLayer({
'id': 'markers',
'source': 'markers',
'interactive': true,
'type': 'circle',
'paint': {
'circle-opacity': {
'base': 1.3,
'stops': [[1, 1], [3, 1], [5, 0.25], [10, 0.7], [15, 0.9], [20, 1]]
},
'circle-radius': {
'base': 1.3,
'stops': [[1, 1], [3, 1.1], [8, 1.3], [10, 1.7], [15, 2.5], [20, 17]]
},
'circle-color': '#ffffff'
}
},
'trees'
)
@musicformellons You're probably running into #3710. Try removing 'interactive': true.
@jfirebaugh Yes! That solved my issue. My "initial style" still has 'interactive': true on each layer..., I can not quite make up from #3710 whether that is advisable to do y/n...?!
interactive: true is no longer necessary. Except for #3710, including it or not won't affect the behavior.
Closing as there was no response from the original reporter. @Maturion if you can set up a minimal example, please reopen the bug. Thanks!
Hi everyone, sorry for not replying until now, I had quite a busy time.
I have just set up a JSFiddle: https://jsfiddle.net/tguo140q/
Note how the "Tiraspol" label will disappear when you change the map's language (I suggest trying the example withru or ro), while there's no such problem with street names. When going back to 0.26.0, the city label will be shown. (You might have to zoom in and out a bit to verify this). I have removed 'interactive': true but the layer still won't show up.
Just in case this is important, my data source is valid GeoJSON extracted from OpenStreetMap via overpass-turbo.eu .
Re-opened as request by @Maturion via IRC.
@Maturion -- I think this is the same issue as https://github.com/mapbox/mapbox-gl-js/issues/3779. you need to remove the source-layer property from line 28 of your jsfiddle.