LiveBy / react-leaflet-choropleth

Component for React-Leaflet that adds choropleth functionality
ISC License
16 stars 8 forks source link

How to update the choropleth by geojson #10

Closed Kiollpt closed 7 months ago

Kiollpt commented 3 years ago

The react app get an event that is sent by server side and then updates it to the map.

1st event (Queensbridge)

{
  "type": "FeatureCollection",
  "features": [
    {"type":"Feature","properties":{"boro_code":"1","boro_name":"Queensbridge","shape_area":"636603803.361","shape_leng":"361611.82395","test": 20000
    },"geometry":{"type":"MultiPolygon","coordinates":""}

}]

2nd event (Union Sq)

{
  "type": "FeatureCollection",
  "features": [
    {"type":"Feature","properties":{"boro_code":"2","boro_name":"Union Sq","shape_area":"36603803.361","shape_leng":"261611.82395","test": 200
    },"geometry":{"type":"MultiPolygon","coordinates":""}

}]

I want to update all events on the map. And if the same boro_name have been occured then updates the value of test.

Any suggestion?