Issue description
I've bound the zoomChange output to a simple logging function. However, I can't get the zoom level.
Current behavior
Seems like no arguments are being passed to my callback
Expected/desired behavior
Zoom should be passed on each call
angular2 & angular2-google-maps version
Angular2 2.0.0
AGM 0.15.0
<ion-content class="map">
<sebm-google-map [latitude]="lat"
[longitude]="lng"
[zoom]="16"
(zoomChange)="zoomChange(z)">
</sebm-google-map>
</ion-content>
zoomChange(event){
console.log(event);
}
every time I zoom, I get undefined in the console.
You need to change z into $event as argument in the template (it's by design in Angular). z really is undefined in your template.
@lazarljubenovic thanks! That works.
Any idea on how to get the center of the map programmatically? Say, after the user has dragged it around a bit?
@jonathan-chin There's centerChange output.
thanks Lazar. I believe I tried that before but it fired multiple times on
drag. so I ideally want to listen for the idle event and get the center
once.
On Oct 31, 2016 2:28 PM, "Lazar Ljubenović" [email protected]
wrote:
@jonathan-chin https://github.com/jonathan-chin There's centerChange
https://github.com/SebastianM/angular2-google-maps/blob/758d3e089823acc45451d64f3e5b89047809e412/src/core/directives/google-map.ts#L207
output.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/SebastianM/angular2-google-maps/issues/724#issuecomment-257378543,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHK8tHHllb2cRInEW8n0dChH7zgOs2JLks5q5jMxgaJpZM4Kiy0A
.
@jonathan-chin you can combine the (idle) output with the (centerChange) event. So track changes from the centerChange output when an idle gets emitted, you can start your logic. Does this help?
Most helpful comment
You need to change
zinto$eventas argument in the template (it's by design in Angular).zreally isundefinedin your template.