googlemaps / googlemaps/extended-component-library

gmp-map click event

Open
#268 0 comments 0 reactions 0 assignees View on GitHub
triage me type: feature request
Dominant language
TypeScript
Stars
192
Forks
22
Avg merge
2d 23h
Merged PRs (30d)
8

Description

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:

`

`

and in the component code:

`latLng = model({
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!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.