NavigationControl
构造函数
创建平移缩放控件
参数 类型 说明 opts可选NavigationControlOptions可选参数 属性 类型 说明 anchorControlAnchor控件的停靠位置 enableGeolocationboolean控件是否集成定位功能 offsetSize控件的水平偏移值 showZoomInfoboolean是否显示级别提示信息 typeNavigationControlType平移缩放控件的类型 返回值 NavigationControl
示例代码1
const navigationControl = new BMap.NavigationControl({
anchor: BMAP_ANCHOR_TOP_LEFT,
type: BMAP_NAVIGATION_CONTROL_LARGE,
showZoomInfo: true,
});
map.addControl(navigationControl);
方法
返回平移缩放控件的类型
返回值 NavigationControlType
设置平移缩放控件的类型
参数 类型 说明 typeNavigationControlType控件类型 返回值 void
示例代码1
navigationControl.setType(BMAP_NAVIGATION_CONTROL_SMALL);
此类表示地图的平移缩放控件。