Fix geometry module field map if one coordinate is missing

This commit is contained in:
Kelani Tolulope
2023-06-23 11:57:00 +01:00
parent 625d02e8d5
commit 60cfddabe7
9 changed files with 56 additions and 35 deletions
@@ -43,6 +43,7 @@
<script>
import { latLng } from 'leaflet'
import { isNumber } from 'lodash'
export default {
props: {
@@ -79,7 +80,11 @@ export default {
},
getLatLng (coordinates = [0, 0]) {
return latLng(coordinates[0], coordinates[1])
const [lat, lng] = coordinates
if (isNumber(lat) && isNumber(lng)) {
return latLng(lat, lng)
}
},
placeMarker ({ latlng = {} }) {