Skip to content

Update to google.maps.marker.AdvancedMarkerElement to Address Deprecation Warning #1037

@wlius-support3

Description

@wlius-support3

Description:

This library currently uses the google.maps.Marker class to implement marker functionality. However, as of February 21st, 2024, google.maps.Marker is marked as deprecated. When using this library, a console warning appears in the browser stating:

As of February 21st, 2024, google.maps.Marker is deprecated. Please use google.maps.marker.AdvancedMarkerElement instead.

This deprecation notice suggests that the library needs to transition to using the new google.maps.marker.AdvancedMarkerElement to ensure future compatibility with the Google Maps JavaScript API.

Steps to Reproduce:

  1. Use the js-markerwithlabel library in a project.
  2. Open the browser console when the map and markers are rendered.
  3. Observe the deprecation warning related to google.maps.Marker.

Proposed Solution:

Update the library to replace usages of google.maps.Marker with google.maps.marker.AdvancedMarkerElement. This update may require additional adjustments to account for differences in behavior and API between the two marker implementations.
This will be a breaking change since the new google.maps.marker.AdvancedMarkerElement does not put almost any methods on the returned marker object compared with the legacy marker (eg all of the get and set methods).

Additional Information:

Updating this library will prevent issues with breaking changes in the Google Maps JavaScript API after the deprecation deadline and maintain compatibility for users of js-markerwithlabel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions