单击标记后,我正在尝试更改缩放级别。我试图重新定义 onMarkerEvent() 内的缩放:
onMarkerEvent(args) {
if (args.eventName === 'markerInfoWindowTapped') {
this.routerExtenstions.navigate([`../item/${args.marker.userData.id}`], { relativeTo: this.activatedRoute });
} else if (args.eventName === 'markerSelect') {
this.zoom = 17;
this.mapView.zoom = this.zoom;
}
}
但是,缩放并没有改变。
在 map.component.tns.html 我有:
<MapView #mapView [latitude]="latitude" [longitude]="longitude"
[zoom]="zoom" [minZoom]="minZoom" [maxZoom]="maxZoom" [bearing]="bearing"
[tilt]="tilt" i-padding="50,50,50,50" [padding]="padding" (mapReady)="onMapReady($event)"
(markerSelect)="onMarkerEvent($event)" (markerInfoWindowTapped)="onMarkerEvent($event)"
(coordinateTapped)="onCoordinateTapped($event)"
(cameraChanged)="onCameraChanged($event)" (mapAnimationsEnabled)="true"
(cameraMove)="onCameraMove($event)">
</MapView>
有想法该怎么解决这个吗?我觉得这可能是我忘记的一些基本的东西。
谢谢!