Source

django-leaflet-storage / leaflet_storage / templates / leaflet_storage / map_init.html

Full commit
    <div id="map"></div>
    <script type="text/javascript">
        {% if locale %}
            L.S.setLocale("{{ locale }}");
        {% endif %}
        map_settings = {
            "storage_id": {{ map.pk }},
            "center": {{ map.center.geojson|safe }},
            "categories": {{ categories|safe }},
            "urls": {{ urls|safe }},
            "default_icon_url": "{{ STATIC_URL }}storage/src/img/marker.png",
            "zoom": {{ map.zoom }},
            "tilelayers": {{ tilelayers|safe }},
            "allowEdit": {{ allowEdit }},
            "embedControl": {{ embedControl }},
            "homeControl": {{ homeControl }},
            "locateControl": {{ locateControl }},
            "jumpToLocationControl": {{ jumpToLocationControl }},
            "enableMarkerDraw": {{ enableMarkerDraw }},
            "enablePolylineDraw": {{ enablePolylineDraw }},
            "enablePolygonDraw": {{ enablePolygonDraw }}
        }
        {% if locateOnLoad %}
            map_settings['locate'] = {"setView": true}
        {% endif %}
        var MAP = new L.Storage.Map("map", map_settings);
    </script>