@uiw/react-amap-types
Advanced tools
Comparing version 4.0.3 to 4.0.4
{ | ||
"name": "@uiw/react-amap-types", | ||
"version": "4.0.3", | ||
"version": "4.0.4", | ||
"description": "基于 React 封装的高德地图组件。AMap Component Based On React.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://uiwjs.github.io/react-amap/#/types", |
@@ -145,3 +145,3 @@ /// <reference path="./base.d.ts" /> | ||
*/ | ||
setLayers(layers:Array<TileLayer | Satellite | Traffic | RoadNet>): void; | ||
setLayers(layers: Array<TileLayer | Satellite | Traffic | RoadNet>): void; | ||
/** | ||
@@ -151,3 +151,3 @@ * 添加覆盖物/图层。参数为单个覆盖物/图层,或覆盖物/图层的数组。 | ||
*/ | ||
add(features: Array<any> | TileLayer | Polyline | Marker | Rectangle | Text | Polygon | InfoWindow | Ellipse | BezierCurve | CircleMarker | Circle | MassMarks): void; | ||
add(features: Array<any> | TileLayer | Polyline | Marker | LabelMarker | Rectangle | Text | Polygon | InfoWindow | Ellipse | BezierCurve | CircleMarker | Circle | MassMarks): void; | ||
/** | ||
@@ -157,3 +157,3 @@ * 删除覆盖物/图层。参数为单个覆盖物/图层,或覆盖物/图层的数组。 | ||
*/ | ||
remove(features: Array<any> | TileLayer | Polyline | Marker | Rectangle | Text | Polygon | InfoWindow | Ellipse | BezierCurve | CircleMarker | Circle | MassMarks): void; | ||
remove(features: Array<any> | TileLayer | Polyline | Marker | LabelMarker | Rectangle | Text | Polygon | InfoWindow | Ellipse | BezierCurve | CircleMarker | Circle | MassMarks): void; | ||
/** | ||
@@ -315,3 +315,3 @@ * 注销地图对象,并清空地图容器 | ||
} | ||
type ControlType = | ||
type ControlType = | ||
'AMap.AutoComplete' | | ||
@@ -348,103 +348,103 @@ 'AMap.ControlBar' | | ||
*/ | ||
onZoomChange?:() => void; | ||
onZoomChange?: () => void; | ||
/** | ||
* 地图平移时触发事件 | ||
*/ | ||
onMapMove?:() => void; | ||
onMapMove?: () => void; | ||
/** | ||
* 鼠标在地图上移动时触发 | ||
*/ | ||
onMouseMove?:(event: MapsEvent) => void; | ||
onMouseMove?: (event: MapsEvent) => void; | ||
/** | ||
* 鼠标滚轮开始缩放地图时触发 | ||
*/ | ||
onMouseWheel?:(event: MapsEvent) => void; | ||
onMouseWheel?: (event: MapsEvent) => void; | ||
/** | ||
* 鼠标移入地图容器内时触发 | ||
*/ | ||
onMouseOver?:(event: MapsEvent) => void; | ||
onMouseOver?: (event: MapsEvent) => void; | ||
/** | ||
* 鼠标移出地图容器时触发 | ||
*/ | ||
onMouseOut?:(event: MapsEvent) => void; | ||
onMouseOut?: (event: MapsEvent) => void; | ||
/** | ||
* 鼠标在地图上单击抬起时触发 | ||
*/ | ||
onMouseUp?:(event: MapsEvent) => void; | ||
onMouseUp?: (event: MapsEvent) => void; | ||
/** | ||
* 鼠标在地图上单击按下时触发 | ||
*/ | ||
onMouseDown?:(event: MapsEvent) => void; | ||
onMouseDown?: (event: MapsEvent) => void; | ||
/** | ||
* 缩放开始时触发 | ||
*/ | ||
onZoomStart?:() => void; | ||
onZoomStart?: () => void; | ||
/** | ||
* 鼠标左键双击事件 | ||
*/ | ||
onDblClick?:(event: MapsEvent) => void; | ||
onDblClick?: (event: MapsEvent) => void; | ||
/** | ||
* 鼠标左键单击事件 | ||
*/ | ||
onClick?:(event: MapsEvent) => void; | ||
onClick?: (event: MapsEvent) => void; | ||
/** | ||
* 缩放结束时触发 | ||
*/ | ||
onZoomEnd?:() => void; | ||
onZoomEnd?: () => void; | ||
/** | ||
* 地图移动结束后触发,包括平移,以及中心点变化的缩放。如地图有拖拽缓动效果,则在缓动结束后触发 | ||
*/ | ||
onMoveEnd?:() => void; | ||
onMoveEnd?: () => void; | ||
/** | ||
* 鼠标右键单击事件 | ||
*/ | ||
onRightClick?:(event: MapsEvent) => void; | ||
onRightClick?: (event: MapsEvent) => void; | ||
/** | ||
* 地图平移开始时触发 | ||
*/ | ||
onMoveStart?:() => void; | ||
onMoveStart?: () => void; | ||
/** | ||
* 开始拖拽地图时触发 | ||
*/ | ||
onDragStart?:() => void; | ||
onDragStart?: () => void; | ||
/** | ||
* 拖拽地图过程中触发 | ||
*/ | ||
onDragging?:() => void; | ||
onDragging?: () => void; | ||
/** | ||
* 停止拖拽地图时触发。如地图有拖拽缓动效果,则在拽停止,缓动开始前触发 | ||
*/ | ||
onDragEnd?:() => void; | ||
onDragEnd?: () => void; | ||
/** | ||
* 鼠标点击热点时触发 | ||
*/ | ||
onHotspotClick?:(event: { type: string, lnglat: LngLat, name: string, id: string }) => void; | ||
onHotspotClick?: (event: { type: string, lnglat: LngLat, name: string, id: string }) => void; | ||
/** | ||
* 鼠标移出热点时触发 | ||
*/ | ||
onHotspotOut?:(event: { type: string, lnglat: LngLat, name: string, id: string }) => void; | ||
onHotspotOut?: (event: { type: string, lnglat: LngLat, name: string, id: string }) => void; | ||
/** | ||
* 鼠标滑过热点时触发 | ||
*/ | ||
onHotspotOver?:(event: { type: string, lnglat: LngLat, name: string, id: string }) => void; | ||
onHotspotOver?: (event: { type: string, lnglat: LngLat, name: string, id: string }) => void; | ||
/** | ||
* 触摸开始时触发事件,仅适用移动设备 | ||
*/ | ||
onTouchStart?:(event: MapsEvent) => void; | ||
onTouchStart?: (event: MapsEvent) => void; | ||
/** | ||
* 地图资源加载完成后触发事件 | ||
*/ | ||
onComplete?:(event: { type: 'complete'}) => void; | ||
onComplete?: (event: { type: 'complete' }) => void; | ||
/** | ||
* 拖拽地图过程中触发,仅适用移动设备 | ||
*/ | ||
onTouchMove?:(event: MapsEvent) => void; | ||
onTouchMove?: (event: MapsEvent) => void; | ||
/** | ||
* 触摸结束时触发事件,仅适用移动设备 | ||
*/ | ||
onTouchEnd?:(event: MapsEvent) => void; | ||
onTouchEnd?: (event: MapsEvent) => void; | ||
/** | ||
* 地图容器尺寸改变事件 | ||
*/ | ||
onResize?:() => void; | ||
onResize?: () => void; | ||
} | ||
@@ -451,0 +451,0 @@ /** |
@@ -65,3 +65,3 @@ /// <reference path="./base.d.ts" /> | ||
/** 文本标注方位 可选值,默认值: `right`。 */ | ||
direction?: 'top'|'right'|'bottom'|'left'|'center'; | ||
direction?: 'top' | 'right' | 'bottom' | 'left' | 'center'; | ||
/** 为偏移量。如设置了 direction,以 direction 方位为基准点进行偏移。 */ | ||
@@ -268,3 +268,3 @@ offset?: AMap.Pixel; | ||
*/ | ||
label?: { content: string; offset: Pixel, direction: 'top'|'right'|'bottom'|'left'|'center' }; | ||
label?: { content: string; offset: Pixel, direction: 'top' | 'right' | 'bottom' | 'left' | 'center' }; | ||
} | ||
@@ -292,3 +292,3 @@ interface MarkerEvents extends EventsCommonProps { | ||
*/ | ||
onMoving?(obj: { passedPath:Array<LngLat> }): void; | ||
onMoving?(obj: { passedPath: Array<LngLat> }): void; | ||
/** | ||
@@ -370,3 +370,3 @@ * 点标记执行moveTo动画结束时触发事件,也可以由moveAlong方法触发 | ||
} | ||
interface PolylineEvents extends EventsCommonProps {} | ||
interface PolylineEvents extends EventsCommonProps { } | ||
interface PolylineOptions { | ||
@@ -487,3 +487,3 @@ /** | ||
} | ||
interface CircleEvents extends EventsCommonProps {} | ||
interface CircleEvents extends EventsCommonProps { } | ||
interface CircleOptions { | ||
@@ -551,3 +551,3 @@ /** 圆心位置 */ | ||
/** 修改圆点标记的属性(样式风格,包括轮廓线、填充色等。属性详情参看CircleMarkerOptions列表) */ | ||
setOptions(optsArg: CircleMarkerOptions): void; | ||
setOptions(optsArg: CircleMarkerOptions): void; | ||
/** 判断指定点坐标是否在圆内 */ | ||
@@ -839,5 +839,5 @@ contains(point: LngLatLike): void; | ||
/** 隐藏 */ | ||
onHide?(data: {type: string, target: any}): void; | ||
onHide?(data: { type: string, target: any }): void; | ||
/** 显示 */ | ||
onShow?(data: {type: string, target: any}): void; | ||
onShow?(data: { type: string, target: any }): void; | ||
} | ||
@@ -852,3 +852,3 @@ /** 多边形 */ | ||
/** 修改多边形属性(样式风格,包括组成多边形轮廓线的节点、轮廓线样式等。属性详情参看PolygonOptions列表) */ | ||
setOptions(opt:PolygonOptions): void; | ||
setOptions(opt: PolygonOptions): void; | ||
/** 获取多边形的属性 */ | ||
@@ -861,3 +861,3 @@ getOptions(): PolygonOptions; | ||
/** 在指定地图上显示当前的多边形。参数取值为null时,在地图上移除当前多边形(自v1.2 新增) */ | ||
setMap(map:Map): void; | ||
setMap(map: Map): void; | ||
/** 设置用户自定义属性,支持JavaScript API任意数据类型,如Polygon的id等 */ | ||
@@ -868,3 +868,3 @@ setExtData(ext: any): void; | ||
/** 判断指定点坐标是否在多边形范围内 */ | ||
contains(point: LngLat): boolean; | ||
contains(point: LngLat): boolean; | ||
} | ||
@@ -937,11 +937,11 @@ interface PolygonOptions { | ||
/** 调用 close 之后触发该事件,target即为编辑后的覆盖物对象 */ | ||
onEnd(data: { target: Polygon}): void; | ||
onEnd(data: { target: Polygon }): void; | ||
/** 增加一个节点时触发此事件 */ | ||
onAddnode(data: { target: Polygon, lnglat: LngLat, pixel: Pixel }): void; | ||
/** 调整折线上某个点时触发此事件 */ | ||
onAdjust(data: { target: Polygon, lnglat: LngLat, pixel: Pixel}): void; | ||
onAdjust(data: { target: Polygon, lnglat: LngLat, pixel: Pixel }): void; | ||
/** 移动覆盖物时触发此事件 */ | ||
onMove(data: { target: Polygon, lnglat: LngLat, pixel: Pixel}): void; | ||
onMove(data: { target: Polygon, lnglat: LngLat, pixel: Pixel }): void; | ||
/** 创建一个覆盖物之后触发该事件,target即为创建对象。当editor编辑对象为空时,调用open接口,再点击一次屏幕就会创建新的覆盖物对象 */ | ||
onAdd(data: { target: Polygon}): void; | ||
onAdd(data: { target: Polygon }): void; | ||
} | ||
@@ -952,3 +952,3 @@ /** | ||
class InfoWindow extends MapEventListener<'open' | 'close'> { | ||
constructor(opt:InforWindowOptions); | ||
constructor(opt: InforWindowOptions); | ||
/** 打开信息窗体 */ | ||
@@ -965,3 +965,3 @@ open(map: Map, pos: LngLat, height?: number): void; | ||
/** 设置信息窗体锚点 默认值:'bottom-center'。 */ | ||
setAnchor(anchor: 'top-left'|'top-center'|'top-right'|'middle-left'|'center'|'middle-right'|'bottom-left'|'bottom-center'|'bottom-right'): void; | ||
setAnchor(anchor: 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'): void; | ||
} | ||
@@ -998,4 +998,4 @@ interface InforWindowOptions { | ||
} | ||
/** 文本标记 */ | ||
class Text extends MapEventListener<'moving' | 'touchmove' | 'touchend' | 'movealong' | 'touchstart' | 'moveend' | 'click' | 'dblclick' | 'rightclick' | 'mousemove' | 'mouseover' | 'mouseout' | 'mousedown' | 'mouseup' | 'dragstart' | 'dragend' | 'dragging'> { | ||
/** 文本标记 */ | ||
class Text extends MapEventListener<'moving' | 'touchmove' | 'touchend' | 'movealong' | 'touchstart' | 'moveend' | 'click' | 'dblclick' | 'rightclick' | 'mousemove' | 'mouseover' | 'mouseout' | 'mousedown' | 'mouseup' | 'dragstart' | 'dragend' | 'dragging'> { | ||
constructor(opts: TextOptions); | ||
@@ -1050,3 +1050,3 @@ /** 获取文本标记内容 */ | ||
onMoveaLong?(): void; | ||
onMoving?(obj: { passedPath:Array<LngLat> }): void; | ||
onMoving?(obj: { passedPath: Array<LngLat> }): void; | ||
onMoveEnd?(): void; | ||
@@ -1093,2 +1093,6 @@ onDragStart?(event: MapsEvent): void; | ||
style?: TextStyleOptions; | ||
// 文本标注的内容,该属性为直接显示在标注上的文本内容。 | ||
content?: string | ||
// 文本标注方位。若设置了 icon,则 direction 是以 icon 为中心的偏移,若未设置 icon,则相对 position 偏移。 可选值:'top' | 'right' | 'bottom' | 'left' | 'center'。默认值: right | ||
direction?: 'top' | 'right' | 'bottom' | 'left' | 'center' | ||
} | ||
@@ -1195,3 +1199,3 @@ type TextStyleOptions = Record<string, any>; | ||
class MassMarks extends MapEventListener<'touchstart' | 'touchend' | 'mousemove' | 'dbclick' | 'click' | 'complete' | 'mouseover' | 'mousedown' | 'mouseup' | 'mouseout'> { | ||
/** 官方文档示例,https://a.amap.com/jsapi/static/doc/index.html#massmarks **/ | ||
/** 官方文档示例,https://a.amap.com/jsapi/static/doc/index.html#massmarks **/ | ||
constructor(data: MassMarkersDataOptions, opts?: Array<MassMarkersOptions> | MassMarkersOptions) | ||
@@ -1223,3 +1227,3 @@ setMap(map: Map): void; | ||
} | ||
interface MassMarkersStyleOptions { | ||
interface MassMarkersStyleOptions { | ||
/** 图标 url */ | ||
@@ -1236,3 +1240,3 @@ url?: string; | ||
/** 海量点加载完成事件 */ | ||
onComplete?: (event: { type: 'complete'}) => void; | ||
onComplete?: (event: { type: 'complete' }) => void; | ||
} | ||
@@ -1253,3 +1257,3 @@ /** | ||
} | ||
interface MoveAlongObj {} | ||
interface MoveAlongObj { } | ||
type MoveToOptions = { | ||
@@ -1302,23 +1306,2 @@ /** 每段动画持续时长, 单位:ms */ | ||
setText(textOpts: TextOptions): void; | ||
getIcon(): IconOptions | undefined; | ||
setIcon(iconOpts: IconOptions): void; | ||
getOptions(): LabelMarkerOptions; | ||
getExtData(): any | undefined; | ||
setExtData(extData: any): void; | ||
setTop(isTop: boolean): void; | ||
getVisible(): boolean | undefined; | ||
getCollision(): boolean | undefined; | ||
remove(): void; | ||
/** 以指定的时长,点标记沿指定的路径移动,加载 AMap.MoveAnimation 后可以使用 */ | ||
moveAlong(path: Array<LngLat> | Array<Vector> | Array<MoveAlongObj>, opts?: MoveAlongOptions): void; | ||
/** 暂停点标记动画,加载 AMap.MoveAnimation 后创建的点标记可以使用 */ | ||
pauseMove(): void; | ||
/** 重新启动点标记动画,加载 AMap.MoveAnimation 后可以使用 */ | ||
resumeMove(): void; | ||
/** 停止点标记动画,加载 AMap.MoveAnimation 后可以使用 */ | ||
stopMove(): void; | ||
/** 开启点标记动画,加载 AMap.MoveAnimation 后可以使用 */ | ||
startMove(): void; | ||
/** 以给定时间移动点标记到指定位置,加载 AMap.MoveAnimation 后可以使用 */ | ||
moveTo(targetPosition: MoveToOptions, opts?: MoveAlongOptions): void; | ||
} | ||
@@ -1346,7 +1329,49 @@ interface LabelMarkerOptions { | ||
text?: TextOptions; | ||
/** 设置文本样式,Object同css样式表,如:{'background-color':'red'} */ | ||
style?: TextStyleOptions; | ||
} | ||
interface LabelMarkerEvents extends EventsCommonProps { | ||
/** | ||
* 鼠标在点标记上按下时触发事件 | ||
*/ | ||
onMouseDown?(event: MapsEvent): void; | ||
/** | ||
* 鼠标在点标记上按下抬起时触发事件 | ||
*/ | ||
onMouseUp?(event: MapsEvent): void; | ||
/** | ||
* 触摸开始时触发事件,仅适用移动设备 | ||
*/ | ||
onTouchStart?(event: MapsEvent): void; | ||
/** | ||
* 触摸移动进行中时触发事件,仅适用移动设备 | ||
*/ | ||
onTouchMove?(event: MapsEvent): void; | ||
/** | ||
* 触摸结束时触发事件,仅适用移动设备 | ||
*/ | ||
onTouchEnd?(event: MapsEvent): void; | ||
/** | ||
* 鼠标左键单击事件 | ||
*/ | ||
onClick?(event: MapsEvent): void; | ||
/** | ||
* 鼠标移动 | ||
*/ | ||
onMouseMove?(event: MapsEvent): void; | ||
/** | ||
* 鼠标移近点标记时触发事件 | ||
*/ | ||
onMouseOver?(event: MapsEvent): void; | ||
/** | ||
* 鼠标移出点标记时触发事件 | ||
*/ | ||
onMouseOut?(event: MapsEvent): void; | ||
} | ||
class ContextMenu extends MapEventListener<'open' | 'close'> { | ||
constructor(opts: ContextMenuOptions); | ||
/** 打开右键菜单 */ | ||
open(map: Map, position: Vector| LngLat): void; | ||
open(map: Map, position: Vector | LngLat): void; | ||
/** 关闭右键菜单 */ | ||
@@ -1353,0 +1378,0 @@ close(): void; |
147503
3760