Customize media markers

This commit is contained in:
2026-04-23 00:15:16 +02:00
parent ef88e600e3
commit 9e4fbe7ad4
4 changed files with 92 additions and 54 deletions

View File

@@ -32,7 +32,8 @@
anchorIcon: 'link',
popupRequested: false,
postMessage: '',
sending: false
sending: false,
focusZoomLevel: 15
};
},
computed: {
@@ -60,7 +61,11 @@
return this.modeHisto?(this.options.formatted_time || '').substr(0, 10):this.options.relative_time;
},
lngLat() {
return (this.options.type == 'message')?(new LngLat(this.options.longitude, this.options.latitude)):null;
return (
['message', 'media'].includes(this.options.type)
&& this.options.longitude
&& this.options.latitude
)?(new LngLat(this.options.longitude, this.options.latitude)):null;
}
},
@@ -80,7 +85,7 @@
if(this.spot.isMobile()) this.project.toggleFeedPanel(false, 'panToInstant');
this.map.panToBetweenPanels(
this.lngLat,
15,
this.focusZoomLevel,
() => {this.map.openMarkerPopup(this.options.id_message);}
);
},
@@ -119,6 +124,7 @@
break;
case 'media':
this.$refs.medialink.openMedia();
if(this.lngLat) this.map.panToBetweenPanels(this.lngLat, this.focusZoomLevel);
break;
}
}