Open
Description
What are you trying to do?
Trying to zoom map after center change:
google-maps.component.html
<google-map
height="600px"
width="100%"
[center]="center"
[zoom]="zoom"
(mapMousemove)="move($event)"
(centerChanged)="centerChanged()">
<map-marker
*ngFor="let markerPosition of markerPositions"
[position]="markerPosition"
[options]="markerOptions"
(mapClick)="openInfoWindow(marker)"
></map-marker>
</google-map>
google-maps.component.ts
export class GoogleMapsComponent {
@Input() center!: google.maps.LatLngLiteral;
zoom = 17;
...
centerChanged() {
console.log('center changed');
this.zoom = 17;
}
What troubleshooting steps have you tried?
Zoom is not changed
Reproduction
Steps to reproduce:
- User changes zoom
- User clicks on marker link that updates center variable.
- Center is changed, console.log is fired but zoom is not updated
Environment
- Angular: 12.2.6
- Browser(s): Firefox/Chrome
- Operating System Windows