Atlaslog
Atlaslog / Leaflet / API reference / Map
Leaflet · API reference

Map

Quick answer

L.map creates the core map instance that owns the view, the layer stack, panes and all interaction handlers. Every layer, control and popup attaches to it, so its center, zoom and CRS options define the whole scene. Call invalidateSize whenever the container size changes.

Last verified 2026-11-03 · Leaflet 1.9.4 · Cite this page
L.map( id , options ) → Map
Key points
Example
map.on('click', function (e) {
  console.log(e.latlng.lat, e.latlng.lng);
});

map.on('moveend', function () {
  console.log(map.getCenter(), map.getZoom());
});
Notes
Runnable examplesChinese originalAll API references
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). Map. https://www.jingweizhi.com/en/leaflet/api/map.html (accessed 2026-11-03).