dapriett / nativescript-google-maps-sdk

Cross Platform Google Maps SDK for Nativescript
MIT License
244 stars 164 forks source link

mapView.zoom not changing zoom #447

Open isabeladowsley opened 3 years ago

isabeladowsley commented 3 years ago

Hey!

In similar lines to what happened to https://github.com/dapriett/nativescript-google-maps-sdk/issues/248 , I am trying to change the zoom level after clicking on a marker with an Android emulator. I've tried to redefine the zoom inside the 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;
        }
}

However, the zoom is not changing.

On map.component.tns.html I have:


<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>   

Any ideas on how to fix this? I feel that should be something basic I am forgetting.

ps: I've tried the ideas from https://github.com/dapriett/nativescript-google-maps-sdk/issues/248 but no success so far.

Thanks