I use raster tiles in my Mapbox application, which I integrate as follows: According to the docs, the expected behaviour for maxzoom should be: Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels. In my case the tiles just disappear
Tag: mapbox-gl-js
How do you get the place name from a mapbox gl js returned queryRenderedFeatures?
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
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
How to unit test a mapbox popup with jasmine testing?
I have a mapbox popup. I am using jasmine and I want to write a unit test for it. So I have this function: and this is the template: and this is my unit test: But I get this error: So what I have to change? Thank you Answer I dont think you should be testing like that. To test
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
mapbox-gl-js: Vector tiles – most efficient way to Change/Add feature property at client-side?
A mapbox-vector-tile layer is being served from GeoServer (around 500K features points and multiline strings). I am using mapbox-gl-js to plot the layer at client side and I use expressions to change certain styles(e.g. line color) I have an external API which will provide me a list of properties for each asset [{ id: 123, prop1: 45, prop2: 78 },
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