I added an array of objects called gisDataSources to actions/index.js. These objects contain a name and url. Optionally they can contain a style property, and an onEachFeature function. If no onEachFeature is provided a generatedOnEachFeature property is added and then used in MapContainer.
The generatedOnEachFeature takes a name argument (The name of the data source) and returns a function that adds a popup with the data source name, district number, and representative on each feature of the overlay.
In MapContainer, instead of adding each layer individually, I map over all the layers and add the overlays.
Related Issue
64 Add new map overlays and cleanup gis code
Motivation and Context
This added new info to the app and causes less confusion for users. It also makes it easier to add new data sources.
How Has This Been Tested?
Locally on my machine.
Screenshots (if appropriate):
Checklist:
[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
Description
I added an array of objects called gisDataSources to actions/index.js. These objects contain a name and url. Optionally they can contain a style property, and an onEachFeature function. If no onEachFeature is provided a generatedOnEachFeature property is added and then used in MapContainer.
The generatedOnEachFeature takes a name argument (The name of the data source) and returns a function that adds a popup with the data source name, district number, and representative on each feature of the overlay.
In MapContainer, instead of adding each layer individually, I map over all the layers and add the overlays.
Related Issue
64 Add new map overlays and cleanup gis code
Motivation and Context
This added new info to the app and causes less confusion for users. It also makes it easier to add new data sources.
How Has This Been Tested?
Locally on my machine.
Screenshots (if appropriate):
Checklist: