vue-yandex-maps
Version:
Yandex Maps 3.0 components library for VueJS.
43 lines (42 loc) • 1.47 kB
TypeScript
import { LngLat, LngLatBounds, YMap } from '@yandex/ymaps3-types';
type YandexMapGetLocationFromBoundsRoundStrategy = 'floor' | 'round' | 'ceil';
export interface YandexMapGetLocationFromBoundsOptions {
bounds: LngLatBounds;
map: YMap;
/**
* @description If true, defaults to floor
* @note also used in comfortZoomLevel
*/
roundZoom?: boolean | YandexMapGetLocationFromBoundsRoundStrategy;
/**
* @description If true, corrects zoom by 1 level if diff from closest Math[roundZoom || 'floor'] value is less than 0.5
* @example 16.8 -> 16.8
* @example 16.5 -> 16.5
* @example 16.4 -> 16
*/
comfortZoomLevel?: boolean | {
/**
* @description max diff from closest Math[roundZoom || 'floor'] value to start correction
* @default 0.5
*/
diff?: number;
/**
* @description how much to correct zoom
* @default 1
*/
correction?: number;
/**
* @default roundZoom is string, 'floor' otherwise
*/
roundStrategy?: YandexMapGetLocationFromBoundsRoundStrategy;
};
}
export declare function getLocationFromBounds({ bounds, map, roundZoom, comfortZoomLevel, }: YandexMapGetLocationFromBoundsOptions): Promise<{
zoom: number;
center: LngLat;
}>;
/**
* @deprecated Use getLocationFromBounds instead
*/
export declare const useYMapsLocationFromBounds: typeof getLocationFromBounds;
export {};