Can't make housenumber layer to be visible
AntonSmolkov opened this issue · 5 comments
Hi.
I generated vectortiles with housnemuber layer, so it definitely exists, i can see it in raw pbf data:
Then I'v added this definition to layers array in basic-style's json:
"filter": [
"==",
"$type",
"Point"
],
"id": "housenumber",
"layout": {
"text-field": "{housenumber}",
"text-font": [
"Noto Sans Regular"
],
"text-size": 11,
"visibility": "visible"
},
"minzoom": 14,
"paint": {
"text-color": "rgba(212, 177, 146, 1)"
},
"source": "basemap",
"source-layer": "housenumber",
"type": "symbol"
},
But housenumbers just don't appear.
Should i enable additional layer in some other plaice?
Thanks in advance.
generated style.json from http://erdapfel_instance/style.json:
style.zip
Your configuration looks good to me. And no additional step should be necessary to render the new layer. Maybe some problem with the layers order ? or because of collisions between visible features ?
To debug further you may want to use mapbox-gl-js API. The mapbox Map instance is accessible via window.map.mb
. For example, to fetch all elements that are rendered from the "housenumber" layer, use:
map.mb.queryRenderedFeatures({layers:['housenumber']})
Ok, so it looks like your custom style is not used.
Can you confirm the "housenumber" layer is present in the response from /style.json
?
I think I have found the root cause of the issue.
Fiddler showed me that real used style was located inside /statics/build/javascript/map.bundle.js file
After running npm build
this file was updated according my style.json and housenumbers eventually appeared.
Sorry if it is something obvious, i don't have much experience with javascript
Ah yes, it makes sense. Once you've updated the style dependency, it's necessary to rebuild the app to update the .js files where the style is bundled.
Whereas the endpoint "/style.json" is defined for external usage, and will generate a new style dynamically. But it's not directly used by the application. Sorry for the confusion.