Skip to content

bug(google-maps): Warning in Console about adding Event-Listener for click instead of gmp-click #30599

@phrei

Description

@phrei
Contributor

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

I'm getting the following warning in console when I use @angular/google-maps@19.2.2:

<gmp-advanced-marker>: Please use addEventListener('gmp-click', ...) instead of addEventListener('click', ...).

Would this mean the following code should be changed to gmp-click as suggested in the warning?

this._eventManager.getLazyEmitter<google.maps.MapMouseEvent>('click');

Reproduction

Create a project that uses the (mapClick)-Output on a <map-advanced-marker>

Expected Behavior

No warning in console.

Actual Behavior

Warning in console.

Environment

  • Angular: 19.2.1
  • CDK/Material: 19.2.2
  • Google-Maps: 19.2.2
  • Browser(s): Chrome
  • Operating System: Windows

Activity

added
needs triageThis issue needs to be triaged by the team
on Mar 7, 2025
crisbeto

crisbeto commented on Mar 7, 2025

@crisbeto
Member

Hmm interesting, something along these lines came up for #30420 and we couldn't use addEventListener, because it was only available in the beta channel of the Maps API.

crisbeto

crisbeto commented on Mar 7, 2025

@crisbeto
Member

Playing with it a bit more, even when using addEventListener('gmp-click') it behaves weirdly. The handler doesn't get fired and it still logs some warning from the clusterer.

king-martinien

king-martinien commented on Mar 8, 2025

@king-martinien

Hello,
I’m experiencing the same issue with <gmp-advanced-marker> in @angular/google-maps@19.2.2.

My setup:

  • Angular version: 19.1.3
  • @angular/google-maps version: 19.2.2
    • Browser: Chrome
added
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
and removed
needs triageThis issue needs to be triaged by the team
on Mar 11, 2025
martinarcejoviva

martinarcejoviva commented on Mar 27, 2025

@martinarcejoviva

I'm experiencing the same issue on a Nuxt app using google maps. Even though I don't use .addListener("click",
I still get those warnings.

emilyDZC

emilyDZC commented on Apr 7, 2025

@emilyDZC

I'm getting the same issue in Vue3 using vue3-google-map@0.21.1. I'm also not using .addListener("click", ...).

boycany

boycany commented on Apr 21, 2025

@boycany

same

onorok

onorok commented on May 12, 2025

@onorok

Add me to the list!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: google-maps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @crisbeto@onorok@phrei@emilyDZC@king-martinien

        Issue actions

          bug(google-maps): Warning in Console about adding Event-Listener for click instead of gmp-click · Issue #30599 · angular/components