Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Commit

Permalink
Improve connection map style
Browse files Browse the repository at this point in the history
  • Loading branch information
Fajfa committed Jul 19, 2022
1 parent c1db53f commit d3fe2ba
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions src/components/ConnectionMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/>

<l-marker
v-for="connection in connections"
v-for="connection in validMarkers"
:key="connection.name"
:lat-lng="getLocationCoordinates(connection)"
>
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/views/Privacy/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

<connection-map
:connections="connections"
class="align-self-center justify-self-center flex-grow-1"
class="align-self-center justify-self-center flex-grow-1 rounded-lg shadow-lg"
/>
</div>
</b-container>
Expand Down

0 comments on commit d3fe2ba

Please sign in to comment.