Add context menu for missing buildings and update fault handling

This commit is contained in:
2025-11-04 09:45:26 +01:00
parent 5c94fe3205
commit 98be5e1614
4 changed files with 362 additions and 76 deletions
+5 -1
View File
@@ -3,7 +3,8 @@ Vue.component('tt-map', {
markersData: { type: Array, default: () => [] },
config: { type: Object, default: () => ({}) },
loading: { type: Boolean, default: false },
showLogo: { type: Boolean, default: false }
showLogo: { type: Boolean, default: false },
contextmenu: { type: Boolean, default: false }
},
data: () => ({
map: null,
@@ -61,6 +62,7 @@ Vue.component('tt-map', {
window.removeEventListener('resize', this.handleResize);
if (this.map) {
this.map.off('zoomend moveend', this.updateTooltipVisibility);
if (this.contextmenu) this.map.off('contextmenu', this.onMapContextMenu);
this.map.remove();
this.map = null;
}
@@ -115,6 +117,7 @@ Vue.component('tt-map', {
this.map.addLayer(this.markerLayer);
this.map.addLayer(this.nonClusteredLayer);
this.map.on('zoomend moveend', this.updateTooltipVisibility);
if (this.contextmenu) { this.map.on('contextmenu', this.onMapContextMenu); }
if (this.showLogo) {
const LogoControl = L.Control.extend({ onAdd: map => {
const container = L.DomUtil.create('div', 'leaflet-control-logo');
@@ -225,6 +228,7 @@ Vue.component('tt-map', {
},
handleSearchFocus() { this.showSearchResults = true; },
handleSearchBlur() { setTimeout(() => { this.showSearchResults = false; }, 200); },
onMapContextMenu(e) { e.originalEvent.preventDefault(); this.$emit('contextmenu', e); },
},
watch: {
markersData: { handler() { this.updateMarkers(); }, deep: true },