Is there any way to programmatically move to a location in react-map-gl I have tried many ways but nothing works I’m using vite as my build tool Answer programmatically move to a location if you mean move smoothly from one to another location by this, checkout flyTo() you can find an example here
Tag: mapbox
Mapbox GL what does ?fresh=true do when loading a tileset?
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
Functional component event is still active when state is toggled – REACT MAPBOX
I’m trying to build an app where you can toggle effects by clicking on the navitems. On the nav items I have an event listener that toggles state The idea is when it’s set to true, you can click on the map to set a waypoint. And when it’s false, clicking does the default behavior. I tried using an if
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
Mapbox raster tiles disappearing despite setting maxzoom
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