UNPKG

@yandex/ymaps3-types

Version:

Types for ymaps3 maps library

28 lines (27 loc) 1.12 kB
import type { GenericGeometry, LngLat } from "../../common/types"; /** * Some active area on the map that can be clicked. * This is not a real YMapEntity, it cannot be added to the map. * But you can check it by `instance of` in YMapListener handlers * For example, in [custom layers](https://yandex.ru/dev/jsapi30/doc/en/dg/concepts/custom-layers) you can pass an object of this type in the `findObjectInPosition` method * Or just listen to the `onEventName` event and check the object: * ```javascript * const map = new ymaps3.YMap(document.getElementById('map-root'), {...}); * map.addChild(new ymaps3.YMapListener({ * layer: 'any', * onClick: (object) => { * if (object instanceof ymaps3.YMapHotspot) { * console.log('Hotspot clicked', object); * } * } * })) * ``` */ declare class YMapHotspot { private static _uid; readonly id: string; readonly geometry?: GenericGeometry<LngLat>; readonly properties: Record<string, unknown>; constructor(geometry: GenericGeometry<LngLat> | undefined, properties: Record<string, unknown>); } export { YMapHotspot };