Fix hover events on message (feed)

This commit is contained in:
2026-01-17 00:57:07 +01:00
parent e70d3ddbd3
commit 4f3be3342c
2 changed files with 34 additions and 26 deletions

View File

@@ -46,7 +46,7 @@ export default {
colors:{'main':'#00ff78', 'off-track':'#0000ff', 'hitchhiking':'#FF7814'},
width: 4
},
popup: null
popup: {content: null, element: null}
};
},
computed: {
@@ -86,8 +86,10 @@ export default {
provide() {
return {
map: {
panTo: this.panTo,
openMarkerPopup: this.openMarkerPopup
panToBetweenPanels: this.panToBetweenPanels,
openMarkerPopup: this.openMarkerPopup,
closeMarkerPopup: this.closeMarkerPopup,
isMarkerVisible: this.isMarkerVisible
},
project: {
...this.$data,
@@ -310,10 +312,7 @@ export default {
//Legend
},
openMarkerPopup(oFeature) {
if(this.popup) {
this.popup.unmount();
this.popup = null;
}
this.closeMarkerPopup();
//Convert ID Message to feature
if(typeof oFeature == 'number') {
@@ -329,7 +328,7 @@ export default {
}
const $Popup = document.createElement('div');
const oPopup = new Popup({
this.popup.element = new Popup({
anchor: 'bottom',
offset: [0, this.markerSize.height * -1],
closeButton: false
@@ -355,11 +354,21 @@ export default {
});
nextTick(() => {
this.popup = createApp(vPopup);
this.popup.mount($Popup);
this.popup.content = createApp(vPopup);
this.popup.content.mount($Popup);
});
},
panTo(oLngLat, iZoom, fCallback) {
closeMarkerPopup() {
if(this.popup.content) {
this.popup.content.unmount();
this.popup.content = null;
}
if(this.popup.element) {
this.popup.element.remove();
this.popup.element = null;
}
},
panToBetweenPanels(oLngLat, iZoom, fCallback) {
const iXOffset = (this.settingsPanelOpen?getOuterWidth(this.$refs.settings):0) - (this.feedPanelOpen?getOuterWidth(this.$refs.feed):0);
this.map.easeTo({
center: oLngLat,
@@ -369,6 +378,9 @@ export default {
});
setTimeout(fCallback, 500);
},
isMarkerVisible(oLngLat){
return this.map.getBounds().contains(oLngLat);
},
getGoogleMapsLink(asInfo) {
return $('<a>', {
href:'https://www.google.com/maps/place/'+asInfo.lat_dms+'+'+asInfo.lon_dms+'/@'+asInfo.latitude+','+asInfo.longitude+',10z',