Questions tagged [react-map-gl]

React friendly API wrapper around MapboxGL JS.

291 questions
2
votes
0 answers

How to get bounding box for styled data in vector tiles

I have a vector tileset (e.g. all the countries in the world). Separately, I am running a query that gets a count for each country (e.g. how many times has X occurred in a given country). Using the query response data, I create a choropleth of the…
sfletche
  • 47,248
  • 30
  • 103
  • 119
2
votes
0 answers

How make a Geojson Layer draggable using React-Map-GL in React?

I am having a GeoJson data and I am displaying it in map using Source and Layer using React-Map-GL, now I want to relocate the position by dragging but I dont know how to do in React? and this is my code
2
votes
1 answer

ReactMapGl clicking on specified layer not possible

I've got a map style set up in Mapbox Studio. This style contains a layer with markers. I want to be able to click on this layer in my React project using react-map-gl. In any other situation i would do something like map.on('click', 'needed-layer',…
Cas
  • 162
  • 1
  • 13
2
votes
1 answer

Is there a way to modify an individual column in a HexagonLayer?

So I created a flat HexagonLayer and have various interactions tied to the onClick prop as shown below. My goal now is to modify the individual column that was clicked by adding an outline, changing the color for that column, or something else…
Chase Ingebritson
  • 1,559
  • 1
  • 12
  • 25
2
votes
1 answer

Is there anything goes wrong while drwaing line in react-map-gl?

I am using react-map-gl as React wrapper for mapbox to draw maps on the screen. I want to add a line into the map. I can achihve this in leaflet using Polyline component. EXAMPLE routes = data.map((points, i) => (
user13319825
2
votes
0 answers

Mapbox error: layers.postcodes.filter[2]: Branch labels must be unique

Can someone help me with this error I am using filters on a layer like so: this gets triggered during a mapbox-gl-draw operation map.setPaintProperty('postcodes', 'fill-color', '#e37d10'); map.setFilter('postcodes', ['in', ['get', 'name'],…
radhikavm
  • 29
  • 7
2
votes
1 answer

React Map GL Draw typescript error "Declaration or statement expected"

I'm trying to add the Editor to my map, but the moment I import "react-map-gl-draw", I get the following error and I can't find anything on it. When I remove the editor, the error is gone and I can see the map. Can someone give me some direction for…
2
votes
1 answer

Filter features within map view React-Map-gl React Hooks

I'm quite new to React and JavaScript, am trying to write a queryRenderedFeatures filter for my React Hooks project using React-Map-gl. The project has a huge list of data, and what I'd like to do is only filtering the data that appears within the…
aichichi
  • 35
  • 2
  • 8
2
votes
1 answer

What is the underlying architecture between Mapbox GL, Deck GL and React Map GL?

I am working on a React webapp that is utilizing an interactive map visualization feature. We are using deck.gl libraries and react-map-gl. React Map GL is defined by Deck GL as a "A React wrapper around Mapbox GL which works seamlessly with…
2
votes
1 answer

How to show building floors in Deck.gl/react-map-gl

So I'm currently working on Deck.gl and React and I need to load a geojson file which has an additional property named "floors" or something similar which tells how many floors the building has. Is there any way to extrude alternating floors…
gallickgunner
  • 472
  • 5
  • 20
2
votes
0 answers

Georeferencing point clouds in deck.gl

I would like to present a point cloud of lidar data over a static map in deck.gl. There is an example of a point cloud positioned on a map in the deck.gl docs. But from the code it isn't clear to me how the example point cloud is georeferenced. …
2
votes
0 answers

How to add custom sources/layers on top of template styles in react-map-gl?

Using react-map-gl I'm unable to overlay my custom sources/layers on top of a predefined style template. When passing the style prop to the map component I am able to add either the template or my custom sources/layers, but not both at once. Here's…
user9371922
2
votes
4 answers

react-map-gl custom markers don't stay at exact position on zoom

I'm working to load a Mapbox map using Uber's react-map-gl library. I have successfully loaded the map with custom markers via JSON served from my API (as you can see from this first image). If you look at the green marker near Houston though, it's…
J. Jackson
  • 3,326
  • 8
  • 34
  • 74
2
votes
1 answer

Update viewport state after fitBounds is called

I have created a map using react-map-gl. Whenever I zoom or pan on the map, the viewport updates as the onViewStateChange prop calls an _updateViewPort function which sets the new state. The issue I am having is, when I zoom into somewhere using…
dugtoni
  • 160
  • 1
  • 13
1
vote
1 answer

how to sum all input values from forminput? The input field was rendered using map method

I calculated the subtotal with child component by passing the arguments as I could not calculate in the parent component itself. Here I used map method for form input. Now I need to calculate the total of subtotal. if I could get a array of all…