fix global map
authorRadek Czajka <rczajka@rczajka.pl>
Tue, 13 Oct 2026 11:04:54 +0000 (13:04 +0200)
committerRadek Czajka <rczajka@rczajka.pl>
Tue, 13 Oct 2026 11:04:54 +0000 (13:04 +0200)
src/references/templates/references/map.html

index b7951c1..da3918b 100644 (file)
    {% cache 60 references-map %}
    {% localize off %}
    {% for e in entities %}
+   {% if e.lat and e.lon %}
+   edata = {{ e.get_json|safe }};
    L.marker(
-       [{{ e.lat }}, {{ e.lon }}],
+       [edata.location[0], edata.location[1]],
        {
-           title: "{{ e.label }}",
-           alt: "{{ e.label }}",
-           mid: {{ e.pk }},
+           title: edata.label,
+           alt: edata.label,
+           mid: edata.id,
        }
    ).on('click', showMarker).addTo(markers);
+   {% endif %}
    {% endfor %}
    {% endlocalize %}
    {% endcache %}