Skip to content

Commit

Permalink
New LocationOSMIDChip component
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed May 31, 2024
1 parent ae466f3 commit b5b52c5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/components/LocationCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
<v-chip label size="small" density="comfortable" class="mr-1" title="OpenStreetMap tag">
{{ getLocationCategory(location) }}
</v-chip>
<v-chip v-if="showLocationOSMID" label size="small" density="comfortable" class="mr-1" title="OpenStreetMap ID">
{{ getLocationOSMID(location) }}
</v-chip>
<LocationOSMIDChip v-if="showLocationOSMID" :location="location" />
</v-card-text>
</v-card>
</template>
Expand All @@ -26,6 +24,7 @@ import utils from '../utils.js'
export default {
components: {
PriceCountChip: defineAsyncComponent(() => import('../components/PriceCountChip.vue')),
LocationOSMIDChip: defineAsyncComponent(() => import('../components/LocationOSMIDChip.vue')),
},
props: {
location: {
Expand Down Expand Up @@ -57,9 +56,6 @@ export default {
getLocationCategory(location) {
return utils.getLocationCategory(location)
},
getLocationOSMID(location) {
return utils.getLocationOSMID(location)
},
goToLocation(location) {
if (this.readonly) {
return
Expand Down
23 changes: 23 additions & 0 deletions src/components/LocationOSMIDChip.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<template>
<v-chip label size="small" density="comfortable" title="OpenStreetMap ID">
{{ getLocationOSMID(location) }}
</v-chip>
</template>

<script>
import utils from '../utils.js'
export default {
props: {
location: {
type: Object,
default: null
}
},
methods: {
getLocationOSMID(location) {
return utils.getLocationOSMID(location)
},
}
}
</script>
3 changes: 3 additions & 0 deletions src/components/LocationSelectorDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<v-chip v-if="showLocationOSMID" label size="small" density="comfortable">
{{ getLocationOSMID(location) }}
</v-chip>
<LocationOSMIDChip v-if="showLocationOSMID" :location="location" />
</v-card-text>
</v-card>
</v-col>
Expand Down Expand Up @@ -132,6 +133,7 @@
<script>
import 'leaflet/dist/leaflet.css'
import { LMap, LTileLayer, LMarker, LPopup } from '@vue-leaflet/vue-leaflet'
import { defineAsyncComponent } from 'vue'
import { mapStores } from 'pinia'
import { useAppStore } from '../store'
import api from '../services/api'
Expand All @@ -143,6 +145,7 @@ export default {
LTileLayer,
LMarker,
LPopup,
LocationOSMIDChip: defineAsyncComponent(() => import('../components/LocationOSMIDChip.vue')),
},
emits: ['location', 'close'],
data() {
Expand Down

0 comments on commit b5b52c5

Please sign in to comment.