react-google-maps-api icon indicating copy to clipboard operation
react-google-maps-api copied to clipboard

google.maps.Marker is deprecated warning

Open gplusdotgr opened this issue 1 year ago • 4 comments

As of February 21st, 2024, google.maps.Marker is deprecated. Please use google.maps.marker.AdvancedMarkerElement instead. At this time, google.maps.Marker is not scheduled to be discontinued, but google.maps.marker.AdvancedMarkerElement is recommended over google.maps.Marker. While google.maps.Marker will continue to receive bug fixes for any major regressions, existing bugs in google.maps.Marker will not be addressed. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/deprecations for additional details and https://developers.google.com/maps/documentation/javascript/advanced-markers/migration for the migration guide.

is there a new version of the library that supports the new gmaps API? (I'm on 2.19.3 )

gplusdotgr avatar Feb 18 '25 08:02 gplusdotgr

I updated the library to 2.20.6 but had to create the markers the way Google recommends

new google.maps.marker.AdvancedMarkerElement({
     map,
     position: { lat, lng },
     content
 });

AndrijBartenev avatar Feb 26 '25 17:02 AndrijBartenev

I updated the library to 2.20.6 but had to create the markers the way Google recommends

new google.maps.marker.AdvancedMarkerElement({
     map,
     position: { lat, lng },
     content
 });

Yeah, I guess that's the workaround for now but pity to be loading the wrapper library and use the native API directly :/

gplusdotgr avatar Feb 27 '25 04:02 gplusdotgr

I see google recommends other lib: https://developers.google.com/codelabs/maps-platform/maps-platform-101-react-js#0

seyhak avatar Mar 01 '25 09:03 seyhak

@JustFly1984 Appreciate your work with this library. 👍 Do you have any plans on updating this to use the Advanced Marker?

jegli avatar Apr 16 '25 07:04 jegli