geolocation-8.x-3.x-dev/js/LayerFeature/GeolocationMarkerScrollToId.js
js/LayerFeature/GeolocationMarkerScrollToId.js
import { GeolocationLayerFeature } from "./GeolocationLayerFeature.js";
/**
* @prop {WidgetSubscriberBase} subscriber
*/
export default class GeolocationMarkerScrollToId extends GeolocationLayerFeature {
onMarkerClicked(marker) {
super.onMarkerClicked(marker);
const id = marker.wrapper.getAttribute("data-scroll-target-id");
if (id) {
document.querySelector(`#${id}:visible`)?.scrollIntoView();
}
}
}
