Skip to content

Commit ebc2f1d

Browse files
authored
Merge pull request #1637 from sim6/fix-poi-actions
Fix POI actions
2 parents fa209c9 + ccf00aa commit ebc2f1d

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

src/components/map/PoiMarker.vue

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,21 @@ export default {
163163
this.map.removeLayer(this.marker);
164164
}
165165
},
166-
methods: {
167-
168-
}
166+
methods: {
167+
onAddFavorite() {
168+
this.$emit('add-favorite', {
169+
latLng: { lat: this.poi.lat, lng: this.poi.lon },
170+
name: this.header,
171+
formattedAddress: formatAddress(this.poi.address),
172+
address: this.poi.address,
173+
})
174+
if (this.map) this.map.closePopup()
175+
},
176+
onAddContact() {
177+
this.$emit('place-contact', {
178+
latLng: { lat: this.poi.lat, lng: this.poi.lon },
179+
})
180+
},
181+
}
169182
}
170183
</script>

src/views/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1686,7 +1686,7 @@ export default {
16861686
|| obj.address.road
16871687
|| obj.address.city_district
16881688
: null
1689-
this.addFavorite(obj.latLng, name, null, obj.formattedAddress || null)
1689+
this.addFavorite(obj.latLng, name, null, obj.formattedAddress || null, null, true, true)
16901690
},
16911691
onAddFavoriteToMap(f) {
16921692
this.chooseMyMap((map) => {

0 commit comments

Comments
 (0)