Skip to content

Commit d930259

Browse files
committed
Fix show OSM object on map when open popup #514
1 parent 97b66d8 commit d930259

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

web/src/pages/map/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
:main_website="main_website"
111111
:remote_url_read="remote_url_read"
112112
@update-issue-uuid="issueUuid = $event"
113-
@q="$refs.osmObject.select($event)"
113+
@elems="$event ? $refs.osmObject.select($event) : $refs.osmObject.clear()"
114114
@remove-marker="
115115
$refs.markerLayer.remove($event)
116116
closed_marker_count += 1

web/src/pages/map/osm-object.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ export default Vue.extend({
1919
},
2020
2121
methods: {
22-
async select(data) {
23-
data.elems_id = data.elems.map((elem) => elem.type + elem.id).join(',')
22+
async select(elems) {
23+
const elems_id = elems.map((elem) => elem.type + elem.id).join(',')
2424
2525
// Get the OSM objects
26-
if (data.elems_id) {
26+
if (elems_id) {
2727
this.clear()
2828
const features = await Promise.all(
29-
data.elems.map((elem) =>
29+
elems.map((elem) =>
3030
fetch(
3131
elem.type === 'node'
3232
? `${this.remoteUrlRead}api/0.6/node/${elem.id}`

web/src/pages/map/popup.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,12 @@ export default Vue.extend({
361361
}
362362
},
363363
364+
watch: {
365+
elems() {
366+
this.$emit('elems', this.elems)
367+
},
368+
},
369+
364370
computed: {
365371
api_url(): string {
366372
return (API_URL.startsWith('http') ? '' : location.protocol) + API_URL

0 commit comments

Comments
 (0)