UNPKG

vue-tianditu2

Version:
253 lines (252 loc) 7.84 kB
import { PropType } from 'vue'; import { Bounds, ControlName, ControlOptions, DefineEmits, DefineProps, LngLat, LngLats } from '../../utils/types'; import { LoadConfig } from '../../use/apiLoader'; export declare const NATIVE_PROPS: { /** EPSG:900913(墨卡托投影),EPSG:4326(大地平面投影) */ projection: { type: PropType<T.MapCode>; default: string; }; /** 地图允许展示的最小级别 */ minZoom: { type: NumberConstructor; default: number; }; /** 地图允许展示的最大级别 */ maxZoom: { type: NumberConstructor; default: number; }; /** 地图的初始化中心点 */ center: { type: PropType<LngLat>; default: () => number[]; }; /** 地图的初始化级别 */ zoom: { type: NumberConstructor; default: number; }; }; export declare const EXTRA_PROPS: { /** 启用地图拖拽,默认启用 */ drag: { type: BooleanConstructor; default: boolean; }; /** 启用滚轮放大缩小,默认启用 */ scrollWheelZoom: { type: BooleanConstructor; default: boolean; }; /** 启用双击放大,默认启用 */ doubleClickZoom: { type: BooleanConstructor; default: boolean; }; /** 启用键盘操作,默认启用 */ keyboard: { type: BooleanConstructor; default: boolean; }; /** 启用地图惯性拖拽,默认启用 */ inertia: { type: BooleanConstructor; default: boolean; }; /** 启用连续缩放效果,默认启用 */ continuousZoom: { type: BooleanConstructor; default: boolean; }; /** 启用双指操作缩放,默认启用 */ pinchToZoom: { type: BooleanConstructor; default: boolean; }; /** 启用自动适应容器尺寸变化,默认启用 */ autoResize: { type: BooleanConstructor; default: boolean; }; /** 当这个选项被设置后,地图被限制在给定的地理边界内,当用户平移将地图拖动到视图以外的范围时会出现弹回的效果,并且也不允许缩小视图到给定范围以外的区域(这取决于地图的尺寸)。使用setMaxBounds方法可以动态地设置这种约束 */ maxBounds: { type: PropType<Bounds>; }; /** 根据提供的坐标点数组设置地图视野,调整后的视野会保证包含提供的坐标点 */ viewport: { type: PropType<LngLats>; }; /** 地图样式,原天地图api的style,分别为black,indigo */ mapStyle: { type: PropType<"black" | "indigo">; }; /** 地图容器id */ mid: { type: StringConstructor; default: () => string; }; /** 控件 */ controls: { type: PropType<(ControlName | ControlOptions)[]>; default: () => never[]; }; /** 加载Api的配置 */ loadConfig: { type: PropType<LoadConfig>; }; }; export declare const NATIVE_EVENTS: T.MapEvents; export declare const EXTRA_EVENTS: { /** 地图初始化 */ init: (e: T.Map) => boolean; /** 鹰眼视图控件的开合状态变化时触发事件 */ viewchange: (e: T.ControlOverviewMapEvent) => boolean; }; export declare const PROPS: { /** 启用地图拖拽,默认启用 */ drag: { type: BooleanConstructor; default: boolean; }; /** 启用滚轮放大缩小,默认启用 */ scrollWheelZoom: { type: BooleanConstructor; default: boolean; }; /** 启用双击放大,默认启用 */ doubleClickZoom: { type: BooleanConstructor; default: boolean; }; /** 启用键盘操作,默认启用 */ keyboard: { type: BooleanConstructor; default: boolean; }; /** 启用地图惯性拖拽,默认启用 */ inertia: { type: BooleanConstructor; default: boolean; }; /** 启用连续缩放效果,默认启用 */ continuousZoom: { type: BooleanConstructor; default: boolean; }; /** 启用双指操作缩放,默认启用 */ pinchToZoom: { type: BooleanConstructor; default: boolean; }; /** 启用自动适应容器尺寸变化,默认启用 */ autoResize: { type: BooleanConstructor; default: boolean; }; /** 当这个选项被设置后,地图被限制在给定的地理边界内,当用户平移将地图拖动到视图以外的范围时会出现弹回的效果,并且也不允许缩小视图到给定范围以外的区域(这取决于地图的尺寸)。使用setMaxBounds方法可以动态地设置这种约束 */ maxBounds: { type: PropType<Bounds>; }; /** 根据提供的坐标点数组设置地图视野,调整后的视野会保证包含提供的坐标点 */ viewport: { type: PropType<LngLats>; }; /** 地图样式,原天地图api的style,分别为black,indigo */ mapStyle: { type: PropType<"black" | "indigo">; }; /** 地图容器id */ mid: { type: StringConstructor; default: () => string; }; /** 控件 */ controls: { type: PropType<(ControlName | ControlOptions)[]>; default: () => never[]; }; /** 加载Api的配置 */ loadConfig: { type: PropType<LoadConfig>; }; /** EPSG:900913(墨卡托投影),EPSG:4326(大地平面投影) */ projection: { type: PropType<T.MapCode>; default: string; }; /** 地图允许展示的最小级别 */ minZoom: { type: NumberConstructor; default: number; }; /** 地图允许展示的最大级别 */ maxZoom: { type: NumberConstructor; default: number; }; /** 地图的初始化中心点 */ center: { type: PropType<LngLat>; default: () => number[]; }; /** 地图的初始化级别 */ zoom: { type: NumberConstructor; default: number; }; }; export declare const EVENTS: { /** 地图初始化 */ init: (e: T.Map) => boolean; /** 鹰眼视图控件的开合状态变化时触发事件 */ viewchange: (e: T.ControlOverviewMapEvent) => boolean; click(e: T.MapEvent): void; dblclick(e: T.MapEvent): void; contextmenu(e: T.MapEvent): void; mousemove(e: T.MapEvent): void; mouseover(e: T.MapEvent): void; mouseout(e: T.MapEvent): void; movestart(e: T.MapEventBase): void; move(e: T.MapEventBase): void; moveend(e: T.MapEventBase): void; zoomstart(e: T.MapEventBase): void; zoomend(e: T.MapEventBase): void; addoverlay(e: T.MapEventBase & { addoverlay: T.Overlay; }): void; removeoverlay(e: T.MapEventBase & { removeoverlay: T.Overlay; }): void; addcontrol(e: T.MapEventBase & { addcontrol: T.Control; }): void; removecontrol(e: T.MapEventBase & { removecontrol: T.Control; }): void; clearoverlays(e: T.MapEventBase): void; dragstart(e: T.MapEventBase): void; drag(e: T.MapEventBase): void; dragend(e: T.MapEventBase): void; layeradd(e: T.MapEventBase & { layer: T.TileLayer; }): void; layerremove(e: T.MapEventBase & { layer: T.TileLayer; }): void; load(e: T.MapEventBase): void; resize(e: T.MapEventBase & { newSize: T.Point; oldSize: T.Point; }): void; levels(e: T.MapEventBase & { minZoom: number; maxZoom: number; }): void; touchstart(e: T.MapEvent): void; touchmove(e: T.MapEvent): void; touchend(e: T.MapEvent): void; longpress(e: T.MapEvent): void; }; export type Props = DefineProps<typeof PROPS>; export type Emit = DefineEmits<typeof EVENTS>;