| 方法 | 返回值 | 描述
|
| centerAndZoom(center:Point, zoom:Number)
| none | 设初始化地图。
如果center类型为Point时,zoom必须赋值,范围3-19级,若调用高清底图(针对移动端开发)时,zoom可赋值范围为3-18级。如果center类型为字符串时,比如“北京”,zoom可以忽略,地图将自动根据center适配最佳zoom级别。
|
| panTo(center:Point[, opts:PanOptions])
| none | 将地图的中心点更改为给定的点。如果该点在当前的地图视图中已经可见,则会以平滑动画的方式移动到中心点位置。可以通过配置强制移动过程不使用动画效果。
|
| setCenter(center:Point|String)
| none | 设置地图中心点。center除了可以为坐标点以外,还支持城市名。
|
| setViewport(view:Array<Point>|Viewport[, viewportOptions: ViewportOptions])
| none | 根据提供的地理区域或坐标设置地图视野,调整后的视野会保证包含提供的地理区域或坐标。
|
| setZoom(zoom:Number)
| none | 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。
|
| highResolutionEnabled()
| Boolean | 是否使用高分辨率底图。仅当mapOptions.enableHighResolution属性为true且设备支持高分辨率时返回true。
|
| 事件 | 参数 | 描述
|
| click
| {type, target, point, pixel, overlay} | 左键单击地图时触发此事件。
当双击时,产生的事件序列为:
click click dblclick
|
| dblclick
| {type, target, pixel, point} | 鼠标双击地图时会触发此事件。
|
| moveend
| {type, target} | 地图移动结束时触发此事件。
|
| zoomend
| {type, target} | 地图更改缩放级别结束时触发触发此事件。
|
| addoverlay
| {type, target} | 当使用Map.addOverlay()方法向地图中添加单个覆盖物时会触发此事件。
|
| addcontrol
| {type, target} | 当使用Map.addControl()方法向地图中添加单个控件时会触发此事件。
|
| removecontrol
| {type, target} | 当使用Map.removeControl()方法移除单个控件时会触发此事件。
|
| removeoverlay
| {type, target} | 当使用Map.removeOverlay()方法移除单个覆盖物时会触发此事件。
|
| clearoverlays
| {type, target} | 当使用Map.clearOverlays()方法一次性移除全部覆盖物时会触发此事件。
|
| addtilelayer
| {type, target} | 添加一个自定义地图图层时触发此事件。
|
| removetilelayer
| {type, target} | 移除一个自定义地图图层时触发此事件。
|
| load
| {type, target, pixel, point, zoom} | 调用Map.centerAndZoom()方法时会触发此事件。这表示位置、缩放层级已经确定,但可能还在载入地图图块。
|
| resize
| {type, target, size} | 地图可视区域大小发生变化时会触发此事件。
|
| touchmove
| {type, target, point,pixel} | 触摸移动时触发此事件,仅适用移动设备。
|
| touchend
| {type, target, point,pixel} | 触摸结束时触发此事件,仅适用移动设备。
|