diff --git a/web/src/pages/map/index.vue b/web/src/pages/map/index.vue index 9689f1d8..1f212f37 100644 --- a/web/src/pages/map/index.vue +++ b/web/src/pages/map/index.vue @@ -110,7 +110,7 @@ :main_website="main_website" :remote_url_read="remote_url_read" @update-issue-uuid="issueUuid = $event" - @q="$refs.osmObject.select($event)" + @elems="$event ? $refs.osmObject.select($event) : $refs.osmObject.clear()" @remove-marker=" $refs.markerLayer.remove($event) closed_marker_count += 1 diff --git a/web/src/pages/map/osm-object.vue b/web/src/pages/map/osm-object.vue index 7361de60..3e0e0d8b 100644 --- a/web/src/pages/map/osm-object.vue +++ b/web/src/pages/map/osm-object.vue @@ -19,14 +19,14 @@ export default Vue.extend({ }, methods: { - async select(data) { - data.elems_id = data.elems.map((elem) => elem.type + elem.id).join(',') + async select(elems) { + const elems_id = elems.map((elem) => elem.type + elem.id).join(',') // Get the OSM objects - if (data.elems_id) { + if (elems_id) { this.clear() const features = await Promise.all( - data.elems.map((elem) => + elems.map((elem) => fetch( elem.type === 'node' ? `${this.remoteUrlRead}api/0.6/node/${elem.id}` diff --git a/web/src/pages/map/popup.vue b/web/src/pages/map/popup.vue index f7b40150..bfcab5f0 100644 --- a/web/src/pages/map/popup.vue +++ b/web/src/pages/map/popup.vue @@ -361,6 +361,12 @@ export default Vue.extend({ } }, + watch: { + elems() { + this.$emit('elems', this.elems) + }, + }, + computed: { api_url(): string { return (API_URL.startsWith('http') ? '' : location.protocol) + API_URL