You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I want to place a single text label in each polygon while using vector tiles.
Instead I get duplicate labels when I zoom to a polygon and it is being divided by different tiles.
Hi @nitro89! Thank you for using GL JS. I believe this issue is a duplicate of #5583, so I'm going to close this issue in favor of consolidating discussion on that ticket. There is more context on why this behaviour is happening #5583 (comment)
A workaround would be creating a separate source_layer with Point features at the exact place you want the labels to appear, and using that as the source for your symbol layer.
Hello, I want to place a single text label in each polygon while using vector tiles.
Instead I get duplicate labels when I zoom to a polygon and it is being divided by different tiles.
A screenshot of the problem:
![problem](https://user-images.githubusercontent.com/19067193/35678776-44368b92-075d-11e8-9b02-9e6a1784e05d.png)
My code:
`
<script>
var simple = {
"version": 8,
"glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf",
"sources": {
"gushim": {
"scheme":"tms",
"type": "vector",
"tiles": ['http://localhost:8080/geoserver/gwc/service/tms/1.0.0/' + 'mytest:gushim_3857' +'@epsg%3A'+'900913'+'@pbf/{z}/{x}/{y}.pbf']
},
"parcel": {
"scheme":"tms",
"type": "vector",
"tiles": ['http://localhost:8080/geoserver/gwc/service/tms/1.0.0/' + 'mytest:parcels_all_3857' +'@epsg%3A'+'900913'+'@pbf/{z}/{x}/{y}.pbf']
}
},
"layers": [
{
"id": "background",
"type": "background",
"paint": {
"background-color": "rgb(230, 230, 230)"
}
},
{
"id": "gushim_3857",
"type": "fill",
"source": "gushim",
"source-layer": "gushim_3857",
"filter": ["==", "$type", "Polygon"],
"paint": {
"fill-outline-color": "#3887be",
"fill-color": "rgba(0, 0, 255, 0.2)"
}
}
]};
Thanks.
The text was updated successfully, but these errors were encountered: