React friendly API wrapper around MapboxGL JS.
Questions tagged [react-map-gl]
291 questions
1
vote
1 answer
Mapbox: Add controller to Deck.gl component
I'm trying to disable scrollZoom in my DeckGL component. I am, however, having difficulty understanding the documentation for passing Controllers to these objects. My current implementation simplified for brevity is:
new Deck({
controller: {…

mmz
- 1,011
- 1
- 8
- 21
1
vote
0 answers
React Map GL caches error when running in sandbox
I am trying to run the following in a sandbox environment but I keep running into the below error
`Uncaught DOMException: Failed to read the 'caches' property from 'Window': Cache storage is disabled
because the context is sandboxed and lacks the…

James Gregory
- 31
- 1
1
vote
2 answers
high order function in react(useState())
I want to first initialize the location on a map(using latitude and longitude)
And it works as well
I can change Zoom + or - if I put default argument right on useState hook
const [viewport, setViewport] = useState({
width: "100vw",
height:…

GBO
- 19
- 1
- 5
1
vote
1 answer
How to focus viewport to the bottom instead of the center
I am currently using react-map-gl package for creating my application.
In the documentation this block of code focuses on the latitude: 37.7577,
longitude: -122.4376 zoom: 8 in the center of my view. However, I want the focus of latitude: 37.7577,…

James Lee
- 656
- 1
- 7
- 22
1
vote
1 answer
React-map-gl with axios - Error "Can't perform a React state update on an unmounted component"
I have been on this simple file for 3 days and need your help.
I'm new to React, and MapBox too :).
I need to consume an api and display it on a mapbox.
Everything works fine with a JSON (ANNONCE) but with useEffect(axios-asynchronous), I have an…

Francois T
- 40
- 9
1
vote
1 answer
iconlayer is not displaying in deck.gl
Here is documentation for Icon Layer https://deck.gl/docs/api-reference/layers/icon-layer
I want to use this IconLayer to display markers on the map.
I used this like below.
import
import { IconLayer } from "@deck.gl/layers";
Icon mapping
const…

Rahul
- 310
- 2
- 13
1
vote
0 answers
Is there anything while using fill-extrusion in mapbox-gl-js
I am trying to create a polygon in mapbox-gl-js using react. I am using react-map-gl as a wrapper for react of mapbox-gl-js.
I have taken example from here https://docs.mapbox.com/mapbox-gl-js/example/3d-extrusion-floorplan/
and everything is live …
user13319825
1
vote
0 answers
Cannot get Layer properties within a bounding box using queryRenderedFeatures in react-map and react-map-draw
Firstly, I am using the mapRef to get the vanilla API for mapbox for use.
I am using turf.js to calculate the bbox from a polygon feature gotten when I draw a polygon on a layer using Mapbox Draw. After conversion, I use queryRenderedFeatures like…

Nate
- 11
- 2
1
vote
1 answer
Mapbox react - Display route with adjustments to nearest road using list of location points
I'm using mapbox with the wrapper react-map-gl.
I'm trying to draw a route with my array of lat lang points,
I found a partial solution from:
https://github.com/visgl/react-map-gl/issues/591#issuecomment-454307294
The issue is that the presented…

Ar26
- 949
- 1
- 12
- 29
1
vote
1 answer
Get Geocoder address search value to update state in App.js (with react-map-gl-geocoder, mapbox-gl and react-map-gl)
I have my app running in React.
I have installed a map with react-map-gl-geocoder, react-map-gl and mapbox-gl.
I am creating a map application with React map GL, using the Geocoder for address search.
The map works well.
Now I need to be able to…

coder1490
- 11
- 1
1
vote
2 answers
Specific geojson URL is not working within my react app using deck.gl and nebula.gl
Im trying to display a polygon for every country in the world, this locations are within the countries URL but this doesnt get me the polygon in which i want, is uses it as a string. Though within the example the data cannot be fetched but you can…

MacaScull
- 161
- 1
- 10
1
vote
2 answers
CSS on Mapbox Geocoder
I had a question about adding CSS, since I could not find any other issues related to this. I am trying to move the Geocoder Search farther down the map than where it is positioned at 'top-right' and I cannot change it's position, whether I use…

rachelo
- 31
- 1
- 5
1
vote
0 answers
Props not recognized by child node
export default function Parent(){
return(
)
}
export default function Child(props){
return(
{props.items.map(...)}
)
}
**OUTPUT: TypeError:props.items.map()…
1
vote
3 answers
i have run into this error "props map error "
Hi everyone am still learning react by building a dark Mode toggle button that on clicked it changes the mode from light to dark and vice versa. I have ran into a problem when i tried mapping through the state and displaying the data in form of a…
user13824605
1
vote
1 answer
React-map-gl cannot fit within parent
I'm starting to play with react-map-gl.
I followed the example in https://github.com/visgl/react-map-gl.
It worked fine.
However, the size of the map overflows all the way to the right & bottom of my page.
the component is currently inside in a…
Arif Oyong
- 392
- 1
- 3
- 11
I'm starting to play with react-map-gl.
I followed the example in https://github.com/visgl/react-map-gl.
It worked fine.
However, the size of the map overflows all the way to the right & bottom of my page.
the component is currently inside in a…

Arif Oyong
- 392
- 1
- 3
- 11