Skip to content
Advertisement

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 outlining the text

The browser reports an error when referencing the geojson file

When referencing geojson, the browser reports an error as follows My JS code is as follows The geojson data is as follows I checked the official examples and the sample geojson data, and also verified the correctness of the genjson data Answer It’s pretty straightforward: you’re getting a 404 error (file not found) accessing https://domain/resource/point.geojson. That URL (or whatever the

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 because

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 Mapbox’s maps with other layers in the same projection.

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 and it’s

Advertisement