Blog Image

Farewell to an Icon; Google Maps Marker Deprecation on February 21st, 2024

On February 21st, 2024, a significant change unfolded in the realm of web development and mapping enthusiasts. Google announced the deprecation of `google.maps.Marker`, marking the end of an era for one of the most iconic features of the Google Maps API. This change may seem subtle to some, but for those deeply entrenched in the digital mapping landscape, it signifies a shift in performance, accessible interactions and how to utilise map data within the infamous google.maps API.

The Google Maps Marker `google.maps.Marker`

For years, `google.maps.Marker` served as the cornerstone of countless web-based mapping applications, enabling developers to pinpoint locations and annotate maps with precision. Whether it was marking landmarks, highlighting points of interest, or visualising data, the `Marker` class played a vital role in enhancing the usability and interactivity of Google Maps.

However, as technology evolves and user expectations evolve, so too must the tools we use to craft digital experiences. Google’s decision to deprecate `google.maps.Marker` reflects a broader strategy aimed at optimising APIs, improving performance, accessibility adjustments and fostering innovation in the mapping ecosystem.

Introducing the Successor, `google.maps.marker.AdvancedMarkerElement`

While the depreciation of google.maps.Marker may initially cause concern for web developers accustomed to its simplicity, it also opens the door to new possibilities. Google has introduced an alternative approach that sees updated APIs that offer more flexibility, improved performance, more accessible, and better Google Maps integration with modern web development practices.

For instance, web developers can now leverage vector-based markers, which scale more efficiently across different devices and screen resolutions, ensuring a seamless user experience. With that said, it’s no longer necessary to create and embed your own Google Maps Marker image on the map. You can now utilise the colour, background, and outline of the default red pin. Additionally, advancements in browser technology, such as WebGL, enable smoother rendering of complex map vectors, further enhancing performance and interactivity. 

Moreover, Google’s emphasis on supporting website accessibility standards, pushes web developers to create more dynamic and interoperable map applications that extend beyond traditional marker-based representations. This can be through interaction such as drag & drop, touch or on event visual updates via animation and time based mark movements.

Furthermore, Google’s commitment to supporting website accessibility standards encourages developers to craft more dynamic and interoperable map applications that transcend traditional marker-based representations. This can include interactive features such as drag-and-drop functionality, touch-based interactions, or real-time visual updates through animations and timed marker movements.

What does `google.maps.Marker` depreciation mean for my map integration?

Well, what does depreciation actually mean?

Google actually describes this quite well with its recent documentation update to talk about its depreciation of `google.maps.Marker`: “Decommissioned indicates that the product or feature is no longer available. Calling decommissioned software can result in unpredictable behaviour or invalid responses.” – Google

What should you expect if the deprecated code is left in your site?

Expressing this concept can be challenging since every business constructs its applications differently. That said, in an ideal scenario, the map may cease to function, accompanied by errors in communication with the Google API. Conversely, in a worst-case scenario, integrations with other facets of your application may not be fully decoupled, leading to errors stemming from inadequately tested implementations. We strongly advise against waiting until the last minute to contemplate updating. Instead, we encourage you to evaluate the migration with us in advance to pre-empt any potential issues.

How long do I have to update the map before my users see it broken?

Effective immediately, the previous Google Maps Marker implementation is designated as legacy code and is in the final stages of maintenance. This classification aligns with Google’s statement that ‘existing bugs in google.maps.Marker will not be addressed,’ with a commitment to provide a minimum of 12 months notice before support is discontinued. While an official announcement regarding the termination date is pending, we can confirm that the new AdvancedMarkerElement offers a recommended approach for integrating markers into your maps.

Does `google.maps.Marker` depreciation mean my map will look or function differently?

Not necessarily, and for good reason. Google’s new strategy takes into account the significance of its google.maps.Marker service by offering web developers resources to ensure that map applications remain functional and future-proof.

Like any significant technological transition, migrating existing applications may present challenges. In this case, the complexity of migration varies depending on the original implementation. However, this variability offers business owners an opportunity to embrace change and explore new approaches, leveraging best practices in the world of web mapping. 

At Codeminers, our goal is to equip you with comprehensive information to faithfully replicate your current Google maps and markers.

How can I migrate from `google.maps.Marker` to `google.maps.marker.AdvancedMarkerElement?

The Codeminers team boasts extensive expertise in Google Maps integrations, as demonstrated by our recent seamless migration of one of our partner sites. Rest assured, our approach to migrating your business will be just as smooth and seamless. 

Our Google Maps marker migration process:

  • Assessing your current Google Maps marker usage: We will conduct thorough preliminary investigations into the depth of marker usage within your applications, a crucial step to ensure we do not inadvertently disrupt any existing functionality reliant on markers. 
  • Analysing your website’s performance: We will analyse whether your site’s performance could be enhanced through the adoption of a more modern approach of integration, aimed at reducing JavaScript ‘Total Blocking Time’ and ‘Execution Time’.
  • Migrating your Google Maps marker: We will facilitate the seamless migration to Google’s new marker strategy, ensuring a smooth transition and optimised performance for your mapping solutions.

Contact Codeminers to learn more

  • Written by Brandon Slater, May 18 2024