mapbox/mapbox-gl-leaflet

mapbox labels not aligning with countries

markslawton opened this issue · 2 comments

I have a very large map project which uses labels (and only labels from mapbox. That is, I don't get any boundaries or terrain from mapbox.)

I bring those vector tiles into Leaflet Using mapbox-gl-leaflet.

Generally, everything works great. However as soon as the map is taller than it is wide, the labels no longer align with the countries (which have been drawn as polygons using GeoJSON). Here is a pic of what happens and the relevant code is below.map with labels unaligned

Any thoughts or insights would be helpful. Here is the code that brings in the tiles:

settings.globalVariables.labelTiles = L.mapboxGL({
accessToken: myAccessToken,
style: 'mapbox://styles/markslawton/ckgsqyzhi0diy19rwi98mlt4g',
pane: 'labels',
}).addTo(settings.globalVariables.map);

Here's a codePen which shows the problem in a very stripped down form. Anybody have an idea.... labels are above and the polygons (which should line up with them) are below

https://codepen.io/markslawton/pen/NWrJxWx

i think #134 resolved this error. if not, feel free to reply/reopen.