Atlaslog
Atlaslog / Leaflet / API reference / Marker
Leaflet · API reference

Marker

Quick answer

L.marker places a draggable, interactive point symbol on the map with an icon, an optional popup and its own click and drag events. It is the default representation for point features and the usual anchor for user interaction. Options cover icons, opacity, zIndexOffset, keyboard focus and riseOnHover.

Last verified 2026-11-03 · Leaflet 1.9.4 · Cite this page
L.marker( latlng , options ) → Marker
Key points
Example
var icon = L.divIcon({
  className: '',
  html: '<div style="width:14px;height:14px;border-radius:50%;background:#1f5fd0;border:2px solid #fff"></div>',
  iconSize: [14, 14],
  iconAnchor: [7, 7]
});

L.marker([39.9, 116.4], { icon: icon }).addTo(map);
L.marker([39.907359, 116.391263])
  .bindPopup('<b>天安门</b><br>39.907359, 116.391263')
  .on('click', function (e) {
    console.log(e.latlng);
  })
  .addTo(map);
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). Marker. https://www.jingweizhi.com/en/leaflet/api/marker.html (accessed 2026-11-03).