ControlBar 最后更新时间: 2026年07月02日
AMap.ControlBar
A map control that combines rotation, tilt, and reset. Construct a control compass object
new AMap.ControlBar(opts: ControlConfig)Parameter
opts (ControlConfig): Control compass control parameters
Demo
map.plugin(["AMap.ControlBar"], function () {
//Instantiate control
var controlBar = new AMap.ControlBar({
position: "LT",
offset: [10, 10],
});
map.addControl(controlBar);
});Method
remove()
Remove control from map
Demo:
controlBar.remove();show()
Set control visibility
Demo:
controlBar.show();hide()
Hide control settings
Demo:
controlBar.hide();Event
For event object property descriptions, go to:MapsEvent
