This example shows how to create a choropleth map using datamaps.
The data
object's keys should be the "id" of the geographical feature. For US states, it's the state initials ('AL' for Alabama, 'NY' for New York).
Each value of the data
object should include a fillData
key which corresponds to keys in the fills
object of the map configuration.
All data passed in via data
is passed into the popupTemplate
function and all corresponding events.
Events emitted:
- map-click
- map-mouseover
- map-mouseout
- map-touchstart