Adding Layers
Adding layers to your map
To add layers to your map navigate to ../src/data/layers/
and you will see two files:
railaccidents.js
- a sample layer configuration fileindex.js
- the main configuration file for all layers
To add a layer you can either copy the railaccidents.js
layer or modify that layer file. Keep in mind that the name of that file will be the name of the layer variable in the application state.
The following elements must be added for your layer to show up:
Once these are set you can save you layer and open the index.js file
If you were to add a new layer called states, all I need to do is to import that new layer into the index.js file and then set the order of the layers. The bottom most layer will be on top, so in this example railaccidents
will show up on top of the states
layer. That’s it!
Last updated