Skip to content

Commit

Permalink
Renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed May 31, 2024
1 parent 9d8935f commit 6c9da13
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions src/components/LocationOSMIDChip.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<v-chip label size="small" density="comfortable" title="OpenStreetMap ID">
{{ getLocationOSMID(location) }}
{{ getLocationUniqueID(location) }}
</v-chip>
</template>

Expand All @@ -15,8 +15,8 @@ export default {
}
},
methods: {
getLocationOSMID(location) {
return utils.getLocationOSMID(location)
getLocationUniqueID(location) {
return utils.getLocationUniqueID(location)
},
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/LocationOSMTagChip.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<v-chip label size="small" density="comfortable" title="OpenStreetMap tag">
{{ getLocationCategory(location) }}
{{ getLocationTag(location) }}
</v-chip>
</template>

Expand All @@ -15,8 +15,8 @@ export default {
}
},
methods: {
getLocationCategory(location) {
return utils.getLocationCategory(location)
getLocationTag(location) {
return utils.getLocationTag(location)
},
}
}
Expand Down
16 changes: 8 additions & 8 deletions src/components/LocationSelectorDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<v-col cols="12" sm="6">
<v-card
v-for="location in results"
:key="getLocationOSMID(location)"
:key="getLocationUniqueID(location)"
class="mb-2"
width="100%"
elevation="1"
Expand All @@ -62,12 +62,12 @@
<v-col cols="12" sm="6" style="min-height:200px">
<l-map ref="map" v-model:zoom="mapZoom" :center="mapCenter" :use-global-leaflet="false" @ready="initMap">
<l-tile-layer url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" layer-type="base" name="OpenStreetMap" />
<l-marker v-for="location in results" :key="getLocationOSMID(location)" :lat-lng="getLocationLatLng(location)">
<l-marker v-for="location in results" :key="getLocationUniqueID(location)" :lat-lng="getLocationLatLng(location)">
<l-popup>
<h4>{{ getLocationTitle(location, true, false, false) }}</h4>
{{ getLocationTitle(location, false, true, true) }}<br>
<v-chip label size="small" density="comfortable">
{{ getLocationCategory(location) }}
{{ getLocationTag(location) }}
</v-chip>
</l-popup>
</l-marker>
Expand All @@ -92,7 +92,7 @@
</h3>
<v-chip
v-for="location in recentLocations"
:key="getLocationOSMID(location)"
:key="getLocationUniqueID(location)"
class="mb-2"
closable
prepend-icon="mdi-history"
Expand Down Expand Up @@ -210,11 +210,11 @@ export default {
getLocationTitle(location, withName=true, withRoad=false, withCity=true) {
return utils.getLocationTitle(location, withName, withRoad, withCity)
},
getLocationOSMID(location) {
return utils.getLocationOSMID(location)
getLocationUniqueID(location) {
return utils.getLocationUniqueID(location)
},
getLocationCategory(location) {
return utils.getLocationCategory(location)
getLocationTag(location) {
return utils.getLocationTag(location)
},
getLocationLatLng(location) {
return utils.getLocationLatLng(location)
Expand Down
8 changes: 4 additions & 4 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ function getLocationType(locationObject) {
return locationObject.osm_type.toUpperCase()
}

function getLocationOSMID(locationObject) {
function getLocationUniqueID(locationObject) {
// examples: N12345
return `${getLocationType(locationObject)[0]}${getLocationID(locationObject).toString()}`
}

function getLocationCategory(locationObject) {
function getLocationTag(locationObject) {
// examples: shop:supermarket, shop:convenience, shop:bakery, shop:doityourself
// Photon
if (locationObject.properties) {
Expand Down Expand Up @@ -249,8 +249,8 @@ export default {
getLocationTitle,
getLocationID,
getLocationType,
getLocationOSMID,
getLocationCategory,
getLocationUniqueID,
getLocationTag,
getLocationLatLng,
getMapBounds,
getMapCenter,
Expand Down
6 changes: 3 additions & 3 deletions src/views/AddPriceMultiple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
</h3>
<v-chip
v-for="location in recentLocations"
:key="getLocationOSMID(location)"
:key="getLocationUniqueID(location)"
class="mb-2"
:style="isSelectedLocation(location) ? 'border: 1px solid #4CAF50' : 'border: 1px solid transparent'"
@click="setLocationData(location)"
Expand Down Expand Up @@ -590,8 +590,8 @@ export default {
getLocationTitle(location, withName=true, withRoad=false, withCity=true) {
return utils.getLocationTitle(location, withName, withRoad, withCity)
},
getLocationOSMID(location) {
return utils.getLocationOSMID(location)
getLocationUniqueID(location) {
return utils.getLocationUniqueID(location)
},
setLocationData(location) {
this.appStore.addRecentLocation(location)
Expand Down
6 changes: 3 additions & 3 deletions src/views/AddPriceSingle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
</h3>
<v-chip
v-for="location in recentLocations"
:key="getLocationOSMID(location)"
:key="getLocationUniqueID(location)"
class="mb-2"
:style="isSelectedLocation(location) ? 'border: 1px solid #4CAF50' : 'border: 1px solid transparent'"
@click="setLocationData(location)"
Expand Down Expand Up @@ -539,8 +539,8 @@ export default {
getLocationTitle(location, withName=true, withRoad=false, withCity=true) {
return utils.getLocationTitle(location, withName, withRoad, withCity)
},
getLocationOSMID(location) {
return utils.getLocationOSMID(location)
getLocationUniqueID(location) {
return utils.getLocationUniqueID(location)
},
setLocationData(location) {
this.appStore.addRecentLocation(location)
Expand Down

0 comments on commit 6c9da13

Please sign in to comment.