Sample Code Lets say my bounding box is around long/lat [-155.4694, 19.8230], //Mauna Kea My queryRenderedFeatures returns four results which is correct because my bounding box contain 4 national-parks. However I cannot find the place name in the geojson even though all of the national-park names are showing correctly on the map. Example place name would be Mauna Kea which
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 outlining the text
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 Maybe using the {controls: {instructions: false;}} – directive when
Fix the upstream dependency conflict installing NPM packages
I am trying to npm install vue-mapbox mapbox-gl, and I’m getting a dependency tree error. I’m running Nuxt.js SSR with Vuetify and haven’t installed anything related to Mapbox prior to running this install and am getting this error. What’s the right way to go about fixing this upstream dependency conflict? Answer It looks like it’s a problem with peer dependencies
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.
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 Polygon feature.
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