Harmonize marker / popup rendering

This commit is contained in:
2026-05-02 00:16:37 +02:00
parent 560b22c039
commit 95ebc96484
9 changed files with 169 additions and 232 deletions

View File

@@ -84,19 +84,19 @@
this.anchorIcon = 'link';
}, 5000);
},
panMapToMessage() {
panMapToMarker(iAnimDuration=500) {
this.popupRequested = true;
if(this.isMobile()) this.project.toggleFeedPanel(false, 'panToInstant');
this.map.panToBetweenPanels(
this.lngLat,
this.focusZoomLevel,
() => {this.map.openMarkerPopup(this.options.id_message);}
);
this.hash.items = [this.hash.items[0], this.options.type, this.options.id_message];
this.hash.items = [this.hash.items[0], this.options.type, this.options.id];
return this.map.panToBetweenPanels(this.lngLat, this.focusZoomLevel, iAnimDuration).then(() => {
this.openMarkerPopup();
});
},
openMarkerPopup() {
this.mouseOverDrill = true;
if(this.map.isMarkerVisible(this.lngLat)) this.map.openMarkerPopup(this.options.id_message);
if(this.map.isMarkerVisible(this.lngLat)) this.map.openMarkerPopup(this.options.id, this.options.type);
},
closeMarkerPopup() {
this.mouseOverDrill = false;
@@ -127,12 +127,12 @@
executeMainAction() {
switch(this.options.type) {
case 'message':
this.panMapToMessage();
break;
return this.panMapToMarker(0);
case 'media':
this.$refs.medialink.openMedia();
if(this.lngLat) this.map.panToBetweenPanels(this.lngLat, this.focusZoomLevel);
break;
if(this.lngLat) return this.panMapToMarker(0);
default:
return Promise.resolve();
}
}
},
@@ -161,12 +161,12 @@
</div>
<div class="body">
<div v-if="options.type == 'message'" class="body-box">
<div class="drill" @click.prevent="executeMainAction" @mouseenter="openMarkerPopup" @mouseleave="closeMarkerPopup">
<div class="drill" @click.prevent="() => {this.panMapToMarker();}" @mouseenter="openMarkerPopup" @mouseleave="closeMarkerPopup">
<span v-if="options.weather_icon && options.weather_icon!='unknown'" class="weather clickable" :title="lang.get('weather.'+options.weather_icon)">
<spotIcon :icon="options.weather_icon" :text="Math.round(options.weather_temp)+'°C'" text-classes="temperature" />
</span>
<img class="staticmap clickable" :title="lang.get('media.click_zoom')" :src="options.static_img_url" />
<spotIconStack :mainClasses="'message drill-icon'" :iconMain="drillMainIcon" :iconSub="'footprint'" :icon-sub-transform="'rotate-270'" />
<spotIconStack :mainClasses="'message drill-icon'" :iconMain="drillMainIcon" iconSub="footprint" :icon-sub-transform="'rotate-270'" />
<div class="comment">
<p>
<spotIcon :icon="'coords'" margin="right" size="lg" />
@@ -179,7 +179,7 @@
</div>
</div>
<div v-else-if="options.type == 'media'" class="body-box">
<projectMediaLink :options="options" :type="'post'" ref="medialink" />
<projectMediaLink :options="options" :type="'post'" ref="medialink" @opening-lightbox="() => {if(this.lngLat) return this.panMapToMarker();}" />
</div>
<div v-else-if="options.type == 'post'">
<p class="message">{{ options.content }}</p>