目前支持用户设置缩放控件、定位控件、比例尺控件的显示/隐藏以及显示位置。
Button('显示', { type: ButtonType.Capsule, stateEffect: true }).onClick(() => {emitter.emit({ eventId: Event.LocationCom }, {data: {show: true,mapViewId: this.mapController?.mapViewId}})emitter.emit({ eventId: Event.ScaleCom }, {data: {show: true,mapViewId: this.mapController?.mapViewId}})emitter.emit({ eventId: Event.ZoomCom }, {data: {show: true,mapViewId: this.mapController?.mapViewId}})}).borderRadius(8).backgroundColor(0x317aff).margin(5)Button('隐藏', { type: ButtonType.Capsule, stateEffect: true }).onClick(() => {emitter.emit({ eventId: Event.LocationCom }, {data: {show: false,mapViewId: this.mapController?.mapViewId}})emitter.emit({ eventId: Event.ScaleCom }, {data: {show: false,mapViewId: this.mapController?.mapViewId}})emitter.emit({ eventId: Event.ZoomCom }, {data: {show: false,mapViewId: this.mapController?.mapViewId}})Button('改变位置', { type: ButtonType.Capsule, stateEffect: true }).onClick(() => {emitter.emit({ eventId: Event.LocationCom }, {data: {show: true,mapViewId: this.mapController?.mapViewId,y: -200}})emitter.emit({ eventId: Event.ScaleCom }, {data: {show: true,mapViewId: this.mapController?.mapViewId,y: -200}})emitter.emit({ eventId: Event.ZoomCom }, {data: {show: true,mapViewId: this.mapController?.mapViewId,y: -200}})}).borderRadius(8).backgroundColor(0x317aff).margin(5)
目前支持指北针控件、定位图标控件的属性设置。
可以设置显示位置、是否显示
this.mapController.mapStatus.setRotate(30).setCenterPoint(new LatLng(30, 112)).refresh();this.compass = this.mapController.getLayerByTag(SysEnum.LayerTag.COMPASS) as CompassLayer;this.compass && (this.compass.x = 64);this.compass && (this.compass.y = 64);// 设置显示/隐藏// this.compass && (this.compass.visible = true);
可以设置显示位置、是否显示以及图标指向、扩散范围
let result = this.mapController.getLayerByTag(SysEnum.LayerTag.LOCATION);if(result){// 设置定位图标位置、指向以及范围this.loc = result as LocationLayer;this.loc.location = new LatLng(30, 112);this.loc.direction = 90;// 单位米this.loc.radius = 1000;}
上一篇
下一篇
本篇文章对您是否有帮助?