Search code examples
angularionic-frameworkionic4angular-google-mapsagm

clickMap event doesn't return coordinates | Ionic | Angular Google Maps


I have a map and a mapClick event and I'm trying to get coordinates.

ts file

onMapClick(event) {
        console.log(event);
    }

html file

<agm-map (mapClick)="onMapClick($event)" [latitude]="latitude" [longitude]="latitude"
                         [zoom]="13">
    <agm-marker [latitude]="latitude" [longitude]="latitude"></agm-marker>
</agm-map>

But the console returns c instead of coordinates. I have the same code in another project (Angular) and it works as expected.


Solution

  • I checked the @agm/core version and it was the 3.0.0-beta.0 so I tried to go back to the previous version 1.1.0 and now it works as expected.