React friendly API wrapper around MapboxGL JS.
Questions tagged [react-map-gl]
291 questions
0
votes
1 answer
Map markers don't load on componentDidMount
I have a map that gets the user location from the viewport coordinates, then it uses those coordinates to fetch the markers from an API. Problem is my markers only show up AFTER I move the map. I am confused as to what I'm…

JohnFajardo
- 95
- 1
- 8
0
votes
0 answers
Mouse/touch event problem with deck.gl layers and react-map-gl overlays
I'm writing a web app using react-map-gl and deck.gl, and my challenge is to get the mouse events set up correctly.
If I use react-map-gl on top of deck.gl, deck.gl layers don't receive my mouse events, and if I do it the other way around,…

mglonnro
- 151
- 10
0
votes
1 answer
react-map-gl: uncaught ReferenceError: _typeof is not defined
Trying to work with react-map-gl but can't get the simplest lib example to work. As soon as I try to render the map I get this weird error in console I'm unable to understand:
Uncaught ReferenceError: _typeof is not defined
at mr…

adesurirey
- 2,549
- 2
- 16
- 36
0
votes
1 answer
React useEffect doesn't change data displayed on map
I'm playing with uber's react-map-gl and deck-gl libraries to try to display data dynamically.I've got 2 components in my react little app.A navigation bar and a Mapbox map.So here is my pipeline.When the page first loads,only the map is displayed…

Christian LSANGOLA
- 2,947
- 4
- 22
- 36
0
votes
1 answer
Map component only partially displaying layer: React Map GL 3.X to 5.X upgrade
I have attempted to update my react map gl from 3.x to 5.x and it is very glitchy.
Related github issue with gif displaying the map glitch:
https://github.com/uber/react-map-gl/issues/836
The interactive area of the map takes up the same amount of…

Underwater_developer
- 648
- 7
- 20
0
votes
3 answers
How can I change react-map-gl icons?
I'm trying to customize my web application's map, I'm using react-map-gl (Uber opensource code) I try to change the map's icon pins but I could not figure out, what does the string code ICON mean?
import React, { PureComponent } from 'react';
const…

captainozlem
- 61
- 5
0
votes
1 answer
How to pass an array of coordinates to react-map-gl heatmap layer?
having some trouble reconciling the docs to my use-case. I got a little stuck trying to get openstreet maps into react using d3, and have been playing around with react-map-gl...great library that's pretty dialed-in! This library is built on top of…

Union In Design
- 141
- 1
- 6
0
votes
1 answer
Map is not showing up
I am using React-Map-GL but it's not appearing and I'm not sure why.
Here is the component I am trying to render:
import ReactMapGL, {Marker} from 'react-map-gl';
import React, {Component} from 'react';
import {apikey} from '../api/api';
class…

Last_Node_Standing
- 399
- 1
- 20
0
votes
1 answer
React Mapbox Layer: Show different image for marker
I am showing marker by using layer property.
import markerIcon from "../map-marker.png";
const image = new Image();
image.src = markerIcon;
const images = ['customImage', image];

Mahesh Gaikwad
- 192
- 2
- 18
0
votes
1 answer
I am trying to use the react-map-gl geolocation example but .geojson data not willing to load
I am trying to use the react-map-gl geolocation example at https://github.com/uber/react-map-gl/tree/4.1-release/examples/geojson but 'data/us-income.geojson' refuses to load (404) in 'app.js'.
import {json as requestJson} from 'd3-request'; …

Pietermachiel
- 1
- 1
0
votes
0 answers
REACT: add geojson data to deck.gl & react-map-gl
I am trying to graph a very simple data here https://raw.githubusercontent.com/pennytalalak/road-crash-data/master/src/data/output.geojson
But it wouldn't display the data on the map. Not sure if it is my geojson file or my code as my console said…

Penny Pang
- 535
- 2
- 8
- 23
0
votes
1 answer
Put coordinates in correct format
I m trying to put location data from backend in react-map-gl, I have a small obstacle about it.
addLines = () => {
const geo = this.state.geo;
const insideGeo = geo.map(dataItem => {
const json = new Buffer(dataItem.payload,…

makho
- 1
- 2
0
votes
1 answer
URL for Mapbox style sheet JSON
Is there a URL that serves up the style sheet JSON for a given style? All the URL's are in Mapbox scheme:
mapbox://styles/wfisher/41dj33random72ravc31c5dyn
But I'd like to download the JSON directly on load so I can modify it before passing in a…

Will
- 3,770
- 3
- 21
- 19
0
votes
1 answer
Loop through state and create multiple components
I'm trying to display location coordinates (of vehicles) on a map with data that I'm fetching every 3 seconds. Every time I fetch the data (array of objects with attribute "Longitude" and "Latitude"), the state will update and I want to update the…

jj008
- 1,033
- 3
- 23
- 48
0
votes
1 answer
Locate to specific bound by using fitBounds of react-mapbox-gl
I want to make the map to relocate to constant bound by button click event.
When page is loaded, it shows the bound that I get the bound that I calculated correctly.
After loading, I need to navigate to the markers that I drew.
After navigating to…

Railway
- 71
- 2
- 13