UNPKG

@yandex/ymaps3-types

Version:

Types for ymaps3 maps library

74 lines (73 loc) 2.38 kB
import type { EasingFunctionDescription, LngLat } from "../../../common/types"; import type { CustomVuefyOptions } from "../../../modules/vuefy"; /** * YMapGeolocationControl props */ type YMapGeolocationControlProps = { /** Geolocation request success callback */ onGeolocatePosition?: (position: LngLat) => void; /** Geolocation request error callback */ onGeolocateError?: () => void; /** Data source id for geolocation placemark */ source?: string; /** Easing function for map location animation */ easing?: EasingFunctionDescription; /** Map location animate duration */ duration?: number; /** Map zoom after geolocate position */ zoom?: number; /** Options for {@link ymaps3.geolocation.getPosition} */ positionOptions?: PositionOptions; }; declare const defaultProps: Readonly<{ duration: 500; positionOptions: { enableHighAccuracy: boolean; timeout: number; maximumAge: number; }; }>; type DefaultProps = typeof defaultProps; /** * Display geolocation control on a map. * * @example * ```javascript * const controls = new YMapControls({position: 'right'}); * const geolocationControl = new YMapGeolocationControl(); * controls.addChild(geolocationControl); * map.addChild(controls); * ``` */ declare class YMapGeolocationControl extends ymaps3.YMapGroupEntity<YMapGeolocationControlProps, DefaultProps> { static defaultProps: Readonly<{ duration: 500; positionOptions: { enableHighAccuracy: boolean; timeout: number; maximumAge: number; }; }>; static [ymaps3.optionsKeyVuefy]: CustomVuefyOptions<YMapGeolocationControl>; private _control; private _button; private _spinner; private _marker; private _loading; private _element; private _unwatchMapContext?; private _unwatchThemeContext?; constructor(props: YMapGeolocationControlProps); private _timeout; private _setLoading; private _position; private _updatePosition; private _handleGeolocationClick; protected _onAttach(): void; protected _onDetach(): void; protected _onUpdate(props: Partial<YMapGeolocationControlProps>): void; private _initMarker; private _updateMarkerIcon; private _updateTheme; } export { YMapGeolocationControl, YMapGeolocationControlProps };