avoid global variables
{% addtoblock "js" %}
<script type="text/javascript">
+(function() {
var data = {{ instance.glossary.leaflet|json }};
var viewMap = L.map('cascadeelement_id-{{ instance.pk }}').setView([data.lat, data.lng], data.zoom);
L.tileLayer(
@@ -42,6 +43,7 @@ marker.bindPopup("{{ marker.glossary.popup_text|safe }}");
{% endif %}
marker.addTo(viewMap);
{% endfor %}
+})();
</script>
{% endaddtoblock %}
