Handle null image location in communication page
This commit is contained in:
parent
29e66327ee
commit
9ca8ec4ce2
1 changed files with 7 additions and 3 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue