From d3fe2bad08d42a91739cd9b70257de24966c916b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C5=BEe=20Fortun?= Date: Fri, 15 Jul 2022 15:45:06 +0200 Subject: [PATCH] Improve connection map style --- src/components/ConnectionMap.vue | 16 +++++++++++++--- src/views/Privacy/Dashboard.vue | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/components/ConnectionMap.vue b/src/components/ConnectionMap.vue index 3698ebf..63c17d7 100644 --- a/src/components/ConnectionMap.vue +++ b/src/components/ConnectionMap.vue @@ -8,7 +8,7 @@ /> @@ -69,9 +69,19 @@ export default { } }, + computed: { + validMarkers () { + return this.connections.filter(({ location = {} }) => { + const { geometry = {} } = location + return !!geometry.coordinates + }) + }, + }, + methods: { - getLocationCoordinates (connection) { - return this.getLatLng(connection.location.geometry.coordinates || []) + getLocationCoordinates ({ location = {} }) { + const { geometry = {} } = location + return this.getLatLng(geometry.coordinates) }, getLocationName (connection) { diff --git a/src/views/Privacy/Dashboard.vue b/src/views/Privacy/Dashboard.vue index fc0b4b2..53d1235 100644 --- a/src/views/Privacy/Dashboard.vue +++ b/src/views/Privacy/Dashboard.vue @@ -55,7 +55,7 @@