inaturalist / inaturalist

The Rails app behind iNaturalist.org
http://www.inaturalist.org
MIT License
640 stars 179 forks source link

Update deprecated google maps Marker #4040

Open pleary opened 3 months ago

pleary commented 3 months ago

Google has deprecated google.maps.Marker in favor of google.maps.marker.AdvancedMarkerElement. There are a few changes we'll need to make to get that working as recommended. See https://developers.google.com/maps/documentation/javascript/advanced-markers/migration for more information.

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.

pleary commented 1 week ago

After looking into this there are a few caveats with switching to AdvancedMarkerElement:

Since Marker is just deprecated right now and they haven't scheduled it for being discontinued yet, maybe we hold off on making any changes. That would mean the browser console will continue to show this long deprecation warning for any pages that implement maps with Markers as there doesn't appear to be any official way to suppress it now that we've acknowledged it. It seems like eventually we'll need to do this work, but we'll get 12 months advanced notice. At that time we should do a big map audit since we'll need to adjust some map styles and move management of styles unto Google Cloud Web UIs, update Marker creation, and we may as well attempt to implement full async load of Google Maps which is another deprecation warning we get on pages that haven't implemented that yet.

For now I'll stop work on this task and recommend we pick it up again when we get the 12 month loss of support notice, and we're prepared to do a larger map audit