fix(gps): iconShape у кастомных маркеров Яндекса — без него hit-test не находил метку, клики уходили в events-pane
This commit is contained in:
@@ -268,6 +268,15 @@ export function Yandex21Map({
|
|||||||
{
|
{
|
||||||
iconLayout: ymaps.templateLayoutFactory.createClass(gpsMarkerHtml(m)),
|
iconLayout: ymaps.templateLayoutFactory.createClass(gpsMarkerHtml(m)),
|
||||||
iconOffset: [-layout.anchorX, -layout.anchorY],
|
iconOffset: [-layout.anchorX, -layout.anchorY],
|
||||||
|
// Активная область клика: без iconShape у кастомного iconLayout
|
||||||
|
// hit-test Яндекса не находит метку — клики уходят в events-pane
|
||||||
|
iconShape: {
|
||||||
|
type: 'Rectangle',
|
||||||
|
coordinates: [
|
||||||
|
[0, 0],
|
||||||
|
[layout.width, layout.height],
|
||||||
|
],
|
||||||
|
} as unknown as ymaps.IGeometryJson,
|
||||||
...(m.zIndex !== undefined ? { zIndex: m.zIndex } : {}),
|
...(m.zIndex !== undefined ? { zIndex: m.zIndex } : {}),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user