Handle null image location in communication page

This commit is contained in:
Eli Ribble 2026-03-20 15:45:55 +00:00
parent 29e66327ee
commit 9ca8ec4ce2
No known key found for this signature in database

View file

@ -290,7 +290,11 @@
let min = { lat: loc.latitude, lng: loc.longitude };
let max = { lat: loc.latitude, lng: loc.longitude };
for (const i of this.selectedCommunication.public_report.images) {
if (i.location.latitude != 0 && i.location.longitude != 0) {
if (
i.location != null &&
i.location.latitude != 0 &&
i.location.longitude != 0
) {
markers.push(
new maplibregl.Marker({
color: "#00FF00",
@ -950,14 +954,14 @@
>Distance from Reporter</small
>
<template
x-if="selectedCommunication.public_report.images[currentPhotoIndex].location.latitude != 0"
x-if="selectedCommunication.public_report.images[currentPhotoIndex].location?.latitude != 0"
>
<span
x-text="formatDistance(selectedCommunication.public_report.images[currentPhotoIndex].distance_from_reporter_meters)"
></span>
</template>
<template
x-if="selectedCommunication.public_report.images[currentPhotoIndex].location.latitude == 0"
x-if="selectedCommunication.public_report.images[currentPhotoIndex].location?.latitude == 0"
>
<span>No location data in image</span>
</template>