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

"google.maps.Marker is deprecated" warning #121

Open
paodb opened this issue Mar 12, 2024 · 1 comment
Open

"google.maps.Marker is deprecated" warning #121

paodb opened this issue Mar 12, 2024 · 1 comment
Labels

Comments

@paodb
Copy link
Member

paodb commented Mar 12, 2024

Got this message while running the add-on:

image

The mentioned link is https://developers.google.com/maps/documentation/javascript/advanced-markers/migration

This needs to be investigated.

@paodb
Copy link
Member Author

paodb commented Apr 22, 2024

I did some testing regarding this issue. Following the instructions in the migration link did not work as straight forward at it is supposed to. Problems or differences I found:
1- To use AdvancedMarkers it is required to define a mapId
2- AdvancedMarkers library needs to be load from within an async function when needed or add the '&libraries=marker' parameter to the API url

Then, found this blogpost that mentions that an Advanced Markers Utility Library for JavaScript developers was also released, and can be use to define Advanced Markers. The web component will need to add the import import {Marker} from '@googlemaps/adv-markers-utils'; and the 2 points mentioned above are needed as well.

Tested both approachs and they both make the demos using markers to break in different ways. For example, icons or colors are not being taken into consideration, clustering does not work (the version of markerclusterer library need to be updated to a newer version to support AdvancedMarkers), there's a setMap method that doesn't seem valid anymore. Logic on how markers are added will need to be reviewed and updated if the migration takes place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: To Do
Development

No branches or pull requests

2 participants