Mapbox GL what does ?fresh=true do when loading a tileset? We are having trouble loading the map in a react page. Removing ?fresh=true sometimes breaks the page and other times fixes it. I’m wondering what it does because I can’t find anything on it online Answer From https://github.com/mapbox/mapbox-sdk-js/issues/364#issuecomment-617894314: Requests that use this param bypass Mapbox’s caching, and request times can
Tag: mapbox-gl-js
Add a Mapbox marker on double click event using React
I’m having some difficulties making my code work. I’m working on an interactive map and I want to add a function that when users “double click” it allows them to add a marker, the function is supposed to pull the long and lat from the map itself. I have this for the part where the function is used: And this
Mapbox JS GL: Filter points by features
I have a mapbox map that displays a number of points from a GEOJson source with several features and independent categories. I want to be able to filter by these features. Ideally when I click on a checkbox filter only the relevant points should remain visible on the layer. So I guess after a click on a checkbox the map
determining circle-color with nested expressions
I use a GeoJSON as my source, where every entity has a state. I want to draw circles for every entity, where the circle color is based on the state, and whether the circle has been clicked or not. Determining the “clicked-state” is done via setFeatureState() where a feature receives the “click” state when clicked. I tried to first check
How can you combine GeoJson features by their property value?
TLDR: Can you join together GeoJSON features that have a common property, such that the final polygon is a combination of the smaller features? I’m building a web application that requires me to modify some existing GeoJSON by removing lines between counties, essentially creating larger polygons out of smaller ones. Here’s what the GeoJSON looks like: In this dummy example,
Mapbox GL JS find closest address to clicked point
I am trying to make a web app where the user can click a point and I can get the closest address to the point. This example from the documentation looks pretty close to what I want to do, except it the queryRenderedFeatures call doesn’t seem to return the physical address of any features. What is the best way to
mapbox change source property
I want to make a cluster layer with mapbox, yes I made it :D. But I want to be able to turn it off So I’m making a source Now I’m able to set the data: After this I am setting the layers for the clusters and circles. Now clustering is working But now: How can I set the cluster:
Mapbox clusterProperties calculate ‘average’ of point property value
I am working on an application using Mapbox GL JS, in which I am showing a heatmap layer, with a data-driven ‘heatmap-weight’ property (based on a custom numerical attribute in my GeoJSON data – ‘detections’). Because many of the points in my data are very near or even overlapping each other, their values of ‘detections’ are often counting the same
Access geometry coordinates with Mapbox expressions somehow?
Every now and then I encounter a code like this: I wonder about ‘$type’ accessor here. Like obviously it allows to grab the type of geometry. But I haven’t seen it mentioned anywhere in the docs. I personally need to access latitude/longitude of the Point geometry. According to documentation it is not something that Mapbox supports. However is it maybe
filter a featurelayer for several values of a specific property mapbox gl js
I’d like to filter a feature layer for several values of a specific property, something like Answer There are three ways to do this: With match With in: With any: