Leaflet - GeoJSON
This example demostrates the use of a
Leaflet.js map consuming and interacting
with GeoJSON
data. Zoom in and out in the state of Colorado to see different features appear, such as county lines and points
of interest markers.
Legend
County Marker
State Line
County Line
Points of Interest
This example demonstrates the following features:
- How to handle layer visibilty based on zoom level
- How to show markers in the center of the visible county polygon as the map is panned or zoomed
- How to retrieve points of interest that are visible within the map's bounding box as the map's view area
change
NOTE: This example implements the use of turf.js for finding the center of a county
polygon. A very nice library for geospatial analysis!