Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
phrei opened this issue Mar 7, 2025 · 4 comments
Open
1 task done
Labels
area: google-maps P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@phrei
Copy link
Contributor

phrei commented Mar 7, 2025

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
@phrei phrei added the needs triage This issue needs to be triaged by the team label Mar 7, 2025
@crisbeto
Copy link
Member

crisbeto commented Mar 7, 2025

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
Copy link
Member

crisbeto commented Mar 7, 2025

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
Copy link

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

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: google-maps and removed needs triage This issue needs to be triaged by the team labels Mar 11, 2025
@martinarcejoviva
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: google-maps P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

4 participants