rungwiroon / BlazorGoogleMaps

Blazor interop for GoogleMap library
MIT License
322 stars 102 forks source link

Feature - AdvancedMarkerClickEvent #353

Open JorgeBlasco opened 3 weeks ago

JorgeBlasco commented 3 weeks ago

This is something still in beta, but since Marker is deprecated in favor of AdvancedMarkerElement, I guess they will keep adding stuff to this class, so It makes sense to create this new event class.

As of today, we only have a few events for AdvancedMarkerElement compared to Marker events.

Some of the Marker and AdvancedMarkerElement click events use the "MapMouseEvent" class, but the new event "gmp-click" uses AdvancedMarkerClickEvent which includes the marker's position.

Offtopic: What I am trying to achieve is detecting an AdvancedMarkerElement "contextmenu" event, but this is not currently supported.

valentasm1 commented 3 weeks ago

I already tried gpm-click event, but couldnt find easy solution. So far click works well even show warning in console. Despite all i agree that gpm-click should be supported. When i will find some free time will jump to that.

Offtopic. I dont use this library. I couldnt suggest solution. You could check for profiles from pull requests. I think these guys for sure use it in daily basis.

valentasm1 commented 1 week ago

I have no idea why event.target return null. tryParseJson function ~73 line. Even tho click event return position. Maybe try find element id and select position from html element itself.