From 1e9939aa6dd0737c79dc91e81041db6caabe47c1 Mon Sep 17 00:00:00 2001 From: artem Date: Mon, 21 Sep 2026 11:56:04 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=BF=D0=B0=D0=B4=D0=B0?= =?UTF-8?q?=D0=BB=D0=B8=20=D0=BA=D1=80=D1=83=D0=B6=D0=BA=D0=B8=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=20=D0=BA=D0=BB=D0=B8=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/workouts/components/WorkoutItem.vue | 36 +++++++++++++++---- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/src/pages/workouts/components/WorkoutItem.vue b/src/pages/workouts/components/WorkoutItem.vue index 44b18ce..4c388fd 100644 --- a/src/pages/workouts/components/WorkoutItem.vue +++ b/src/pages/workouts/components/WorkoutItem.vue @@ -75,13 +75,7 @@
1
@@ -1229,6 +1223,34 @@ const openPhoto = (photo: WorkoutPhoto) => { showLightbox.value = true; } }; +const photoMarkerSettings = new Map< + string, + { coordinates: LngLat; onClick: (e: unknown, event: unknown) => void } +>(); +/** + * Stable per-photo marker settings objects. A fresh inline :settings on every + * parent re-render would patch the YandexMapMarker component, whose onUpdated() + * removes the marker DOM node (it is owned by the clusterer and is not inside + * at that moment); the clusterer then reuses the same entity without + * recreating the element, so the single marker would disappear forever. + */ +function getPhotoMarkerSettings(photo: WorkoutPhoto): { + coordinates: LngLat; + onClick: (e: unknown, event: unknown) => void; +} { + let s = photoMarkerSettings.get(photo.id); + if (!s) { + s = { + coordinates: [ + photo.longitude as number, + photo.latitude as number, + ] as LngLat, + onClick: (_: unknown, __: unknown) => openPhoto(photo), + }; + photoMarkerSettings.set(photo.id, s); + } + return s; +} type ClusterFeature = { geometry: { coordinates: [number, number, ...number[]] }; };