Skip to content

Commit 501c98e

Browse files
Prevent an error when searching by wfi
1 parent 2380330 commit 501c98e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

client/src/components/MapFilters.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</div>
77
<p>{{ props.paragraph }}</p>
88
<q-card
9-
v-if="activePoint && Object.keys(activePoint.properties).length"
9+
v-if="activePoint?.properties && Object.keys(activePoint.properties).length"
1010
class="selected-point q-pa-sm q-ma-sm"
1111
flat
1212
bordered

client/src/components/watershed/Watershed.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,14 @@ const clickMap = (coordinates) => {
297297
};
298298
299299
const getWatershedFromLngLat = (point) => {
300-
activePoint.value = [point[1], point[0]];
301-
clickedPoint.value = { lng: point[1], lat: point[0] };
302-
getWatershedInfoAtLngLat({lng: activePoint.value[0], lat: activePoint.value[1]});
300+
if (point?.latitude) {
301+
activePoint.value = [point.longitude, point.latitude];
302+
clickedPoint.value = { lng: point.longitude, lat: point.latitude};
303+
} else {
304+
activePoint.value = [point[1], point[0]];
305+
clickedPoint.value = { lng: point[1], lat: point[0] };
306+
getWatershedInfoAtLngLat({lng: activePoint.value[0], lat: activePoint.value[1]});
307+
}
303308
};
304309
305310
const getWatershedInfoAtLngLat = async (coordinates) => {

0 commit comments

Comments
 (0)