Skip to content

Tag: mapbox-gl-js

Dynamically change font color based on contrast

I’m looking to change the font color based on the color/contrast of what is behind it. i.e. if the color behind the text is white/light, the text will be black, if the color is dark/black, the font color will be white. Is this something that is achievable with mapbox? Or should I just go the route of ou…

Error: The type property must be definedn in mapbox-gl-js

I have problem in adding source to map. ./temp-data With the above code i am getting this error. If i change to then i am not getting any error. addSource takes an object and id. I am passing id as the first parameter and object as the second parameter. Then why this error is appearing. Answer Your error is b…

Which projection is Mapbox using

I have UTM coordinates, EPSG: 25833. Looking at the Mapbox documentation it says Mapbox supports the popular Web Mercator projection, and does not support any other projections. Web Mercator is a nearly conformal projection that is adopted by the vast majority of web maps and its use allows you to combine Map…

MapBox GL JS marker offset

I’m using MapBox GL JS to create a map with a custom marker: However, I seem to have some kind of offset problem with the marker. The thing is: when zoomed out a bit, the bottom of the marker is not really pointing to the exact location: When I’m zooming in a bit further it reaches its destination…