Questions tagged [react-map-gl]

React friendly API wrapper around MapboxGL JS.

291 questions
12
votes
3 answers

Can I add a GeoJSON line like they do in the (mapbox-gl-js documentation) using react-map-gl?

I'm trying to add a GeoJSON line to show car direction between a point A and a point B ( like they have in the official documentation of mapbox-gl-js (https://www.mapbox.com/mapbox-gl-js/example/geojson-line/) But the docs of react-map-gl doesn't…
AziCode
  • 2,510
  • 6
  • 27
  • 53
11
votes
7 answers

Mapbox blank map React-map-gl | ReactJS

I am using react 17.0.1 and react-map-gl ^6.0.2 i have a map component. I have tried other libraries and the problem persists I have contacted support for mapbox I have contacted other mapbox users Couldnt solve that When i do "npm run start" no…
Rayberk
  • 133
  • 1
  • 8
10
votes
3 answers

Mapbox production error in console. "Uncaught ReferenceError: y is not defined"

I have a full-stack React.js application deployed on Heroku. Everything deployed fine except for Mapbox. In development, everything works nice. As soon as I open my application in Heroku, Mapbox displays a black screen. I have added config vars in…
Abdul
  • 150
  • 1
  • 8
8
votes
2 answers

react-map-gl using multiple sources makes one of them invisible

I've specified two elements under ReactMapGL trying to load two different FeatureCollections with different coloring. It doesn't work when both Sources are present as it hides the first (id: maps-with-yield) and shows the latter (id:…
curiousdev
  • 626
  • 8
  • 24
6
votes
1 answer

react-map-gl Cross-Origin Request does not succeed, not found?

I'm setting up a map in react-map-gl however after providing my access token I am getting the following console error: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at…
hvdm
  • 71
  • 2
6
votes
1 answer

Mapbox GL Js, dynamically changing map container size, can not resize map

My map instance lives in a resizable container, and when I change size I should call map.resize(). I was wondering is there a way to listen to mapbox container resize event so it can trigger map.resize() ? Can you advise how to do it? export default…
6
votes
1 answer

How to use react-map-gl to draw line between two point

I am trying to draw a line between two points using react-map-gl library. I can not find example from the official document, So I am trying to reproduce same behavior from following code snippet which use Mapbox library var map = new mapboxgl.Map({ …
Sean Liu
  • 831
  • 1
  • 11
  • 23
6
votes
1 answer

react-map-gl without API key using osm tiles

Is it possible? This tells me it is, but dont know why it defines and API key. but I cannot get it to work with react-map-gl StaticMap class. The property I can see from that class is just mapStyle which would take a standard Mapbox vector tiles…
Hiwa
  • 587
  • 6
  • 21
6
votes
1 answer

Is it possible to dynamically add to a dataset in kepler.gl

I'm working in kepler.gl and loading in data from a database. I want to be able to dynamically update a dataset if the database is updated. Is there any way to add a row to a dataset and update the map? I've tried removing the dataset (using…
Ali
  • 1,029
  • 1
  • 12
  • 15
5
votes
0 answers

Issue with tracking using Mapbox GL JS on mobile devices

I'm just using the out of the box "GeolocateControl" component from react-map-gl and it works perfectly on my pc. However on my phone when I press of the geolocate button nothing happens? My browser in mobile has permission to access location but no…
Dan Nugent
  • 147
  • 1
  • 1
  • 6
5
votes
1 answer

Unable to capture onClick events on Marker's children included in deck.gl@^7.1.10

I used deck.gl@^6.4.7 and react-map-gl@^5.0.7, and I had placed a Marker with an icon children that was listening on click events. When I updated the deck.gl to version 7.1.10, the icon's click events stopped working. Do you have any idea how to…
4
votes
1 answer

react-map-gl does not resize when sidebar width changes

Hey guys so basically my website is currently looking like this. My aim is to collapse the left sidebar when the user clicks the arrow on top right which turns the smallMapSidebar state true when clicked. However when the width of the sidebar…
Gadmer
  • 51
  • 5
4
votes
1 answer

Display HTML clusters with custom properties using react-map-gl (Mapbox)

I am trying to adapt the example Display HTML clusters with custom properties for react-map-gl. I got basic clusters without custom styling working (adapted from Create and style clusters):
DurandA
  • 1,095
  • 1
  • 17
  • 35
4
votes
1 answer

How to access control instances from map instance in Mapbox

I need a way to access a registered control instance from Mapbox map instance. For example, say I register a hypothetical Mapbox control: const control = new IControl(); // Where IControl is the hypothetical mapbox…
Tunmee
  • 2,483
  • 1
  • 7
  • 13
4
votes
2 answers

React Component Doesn't Update After First Button Click

My code generates an input field that allows a user to enter a value to search for. Then when they click the Submit button, it causes displayMap to be true, so that when the MapDisplay component renders, it will trigger an API search via the Map…
Nova
  • 69
  • 1
  • 8
1
2 3
19 20