Skip to content

Exclude OverlayView from onClick event? #2901

@Bosskee

Description

@Bosskee

Hello!

I'm in a situation where I have a custom component placed on the Map that's wrapped in an OverlayView. The problem is that the Map's onClick event is triggered when I click the custom component. Code:

<GoogleMap
 onClick={ev => handleMapClick(ev)}
<OverlayView mapPaneName={OverlayView.OVERLAY_MOUSE_TARGET} position={{ lat: 55.65962399163509, lng: 13.144821899750333 }}>
            <IncidentMarker />
          </OverlayView>
</GoogleMap>

Notice that my Component <IncidentMarker /> is wrapped in <OverlayView>. I read in the docs that "The click event is not fired if a Marker or InfoWindow was clicked."

I'm wondering if the <OverlayView> also can be excluded from the onClick event? Any ideas on this? Might be a possible feature request.

Thanks for any input on this, and thanks for an awesome library! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions