-
Notifications
You must be signed in to change notification settings - Fork 18
gmp-map click event #268
Copy link
Copy link
Open
Labels
triage meI really want to be triaged.I really want to be triaged.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Metadata
Metadata
Assignees
Labels
triage meI really want to be triaged.I really want to be triaged.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Hello everyone!
I am building an Angular App and I was trying to integrate this extended-component-library to make use of gmp-map component. I couldn't find a way to listen for user clicks on the gmp-map so I can get the exact LatLng where the user clicked, so that I can update the position of the gmp-advanced-marker component.
My goal is to have something like this in the html:
<gmp-map [center]="center()" zoom="17" map-id="DEMO_MAP_ID" (click)="updateMarker($event)"> <gmp-advanced-marker [position]="latLng()"></gmp-advanced-marker> </gmp-map>and in the component code:
latLng = model<google.maps.LatLngLiteral>({ lat: -33.86, lng: 151.22, });updateMarker(event: google.maps.MapMouseEvent) { if (event.latLng) { this.latLng.set(event.latLng.toJSON()); } }Can anyone provide me with some help in this direction?
Thank you!