方向图层
可通过调用CompassLayer类方法或者属性进行定位位置、显示隐藏等控制,通过点击图标可重置地图方向。
MapComponent({ onReady: async (err, mapController) => {if (!err) {// 获取地图的控制器类,用来操作地图this.mapController= mapController;this.compass = this.mapController.getLayerByTag(SysEnum.LayerTag.COMPASS) as CompassLayer;this.compass.x = 64;this.compass.y = 64;}}, mapOptions: new MapOptions(null)}).width('100%').height('100%')
上一篇
下一篇
本篇文章对您是否有帮助?