Skip to content

Tag: mapbox

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…

How to remove directions control on mapbox maps?

I’m using the plugin “mapbox-gl-directions” to get distance. I want to remove the direction control inside the maps. Here is an example guide on image => example of what I’m trying to do Is it possible to remove that and keep the distance box? Here is my code: Thank you. Answer Mayb…

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…

Join two bounding boxes bboxes

I have two bounding boxes and want to create a big one that includes this 2 – join them. For example(2 results of the turf.bbox): Is there an easy way with turf etc.? thanks Answer Maybe this could be solved using a combination of bboxPolygon, combine and bbox. bboxPolygon converts a bounding box to a P…

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…