fix: Handle missing locations
This commit is contained in:
parent
a1edb48ff5
commit
803a6ff000
@ -19,6 +19,7 @@
|
||||
}).addControl(new maplibregl.NavigationControl());
|
||||
|
||||
{% for adoption_notice in adoption_notices %}
|
||||
{% if adoption_notice.location %}
|
||||
// create the popup
|
||||
const popup_{{ forloop.counter }} = new maplibregl.Popup({offset: 25}).setHTML(`{% include "fellchensammlung/partials/partial-adoption-notice-minimal.html" %}`);
|
||||
|
||||
@ -33,5 +34,6 @@
|
||||
.setLngLat(location_popup_{{ forloop.counter }})
|
||||
.setPopup(popup_{{ forloop.counter }}) // sets a popup on this marker
|
||||
.addTo(map);
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</script>
|
||||
|
@ -51,4 +51,7 @@ def get_oxitraffic_script_if_enabled():
|
||||
@register.filter
|
||||
@stringfilter
|
||||
def pointdecimal(value):
|
||||
return f"{float(value):.9f}"
|
||||
try:
|
||||
return f"{float(value):.9f}"
|
||||
except ValueError:
|
||||
return value
|
||||
|
Loading…
Reference in New Issue
Block a user