[Fixed]-Django Admin – Leaflet: Programmatically add a marker to existing map

1👍

Steps for a successfull result:

  1. Get some sleep
  2. Read the Docs
  3. Implement

You can use the Leaflet API as usual. There are two ways to grab a
reference on the just initialized map and options.

<script type="text/javascript">
    window.addEventListener("map:init", function (e) {
        var detail = e.detail;
        ...
        L.marker([50.5, 30.5]).addTo(detail.map);
        ...
    }, false);
</script>

Leave a comment