Along with this version update, we released a Beta version of Maps JavaScript API that reduces its impact onto the JavaScript global namespace of the parent webpage, a.k.a the window object.
Our intention with this change is to avoid involuntarily overwriting global variables or polyfills.
The changes described below ‒ currently only in Beta ‒ will be included in the next version (3.45), which will be mainstreamed into the Weekly release channel in Q2 2021.
What do I need to know?
When JavaScript polyfills are needed by a user's browser for Maps JavaScript API, the API will no longer export those as global variables. As a consequence, pages that mistakenly relied on the API providing polyfills for third-party or embedded code may stop functioning correctly.
Due to these changes, the placeTypePreferences property of the Local Context Library will no longer accept Iterable objects (such as Sets) on Internet Explorer, but only Array-like objects as demonstrated in the documentation.
Additionally, when using the Geometry Library the following variables will no longer be exported into the global namespace: Spherical, PolyGeometry, and PolylineCodec. These facilities will remain available in their intended namespace within google.maps.geometry.
What do I need to do?
If you use Maps JavaScript API, please verify that your pages still work as intended with the Beta version of the API, for instance using a script tag such as this one to load the API:
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap&v=beta"></script>
While we took every precaution to minimize the chance of disruption and estimate the risk of breaking existing pages as very low, we evaluated that customers using the API with the Geometry Library or the Local Context Library are the most likely to be affected by side-effects of these clean-ups, as well as users of Internet Explorer.
How can I get help?
If you determine that your web page requires polyfills, we recommend https://polyfill.io to that effect.
Should you need further help to ensure your web pages remain compatible with Maps JavaScript API, please check out our support options.