leaflet
leaflet
js
What is Leaflet.js
Leaflet.js is an open-source library using which we can deploy simple,
interactive, lightweight web maps.
•Leaflet JavaScript library allows you to use layers such as Tile layers,
WMS, Markers, Popups, Vector layers (polylines, polygons, circles, etc.),
Image overlays and GeoJSON.
•You can interact with the Leaflet maps by dragging the map, zooming (by
double click or, wheel scroll), using keyboard, using event handling, and
by dragging the markers.
www.leafletjs.com
Plugins
Map/tile options
Overlays (clusters, heatmaps, etc)
Advanced pan/zoom
Drawing
Timeline
Alternatives:
Google Maps
MapQuest
OpenLayers
Mapbox GL
Code!
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
Add a map Lat/Lon
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
Add a map Zoom
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
Add a map Tile server URL
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
Draw a pin
var map = L.map('map').setView([39.774, -84.182], 11); // Center on Dayton
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
www.leafletjs.com
https://github.com/mattbanderson/leaflet-demo