codeforgso / GoVote

Local voter registration and election candidate application.
http://govotegso.org/
GNU General Public License v3.0
24 stars 46 forks source link

Add new map overlays and cleanup gis code #64 #65

Closed SchaeStewart closed 6 years ago

SchaeStewart commented 6 years ago

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: