Inspired by @mc0e's query about 'undefined', I have prepared an illustration.
(Adapted from the code found on Leafletjs.com and Leafletjs quick start)
- Navigate to Wikimedia maps (which utilizes the discussed framework).
- Access the browser console (Ctrl+j or Ctrl+k) to add a Marker (you must first define a variable). Refer to Code-1.
Code-1 in console:
var markerLondon = L.marker()
.setLatLng([51.5, -0.09])
.bindPopup('Centre of London')
.addTo(map)
.openPopup();
- You now have a stationary marker. Utilize Code-2 to enable draggability for the Marker.
Code-2 in console:
markerLondon.dragging.enable();
For further information, check out Marker API reference.
Note: In case Wikimedia switches to another platform, experiment with BigMap 2 (also built using the same framework) designed for generating static OpenStreetMap visuals.