Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROU-4883: change Markers to use new Google AdvancedMarker #181

Open
wants to merge 21 commits into
base: dev
Choose a base branch
from

Conversation

rugoncalves
Copy link
Contributor

The Google Maps API, google.maps.Marker, that we are currently using on OutSystemsMaps for markers was deprecated on February 21st 2024 and needs to be replaced with the new one, google.maps.marker.AdvancedMarkerElement.
image
This will cause the warning above to appear, once the Google Maps script is updated to version v3.56 and above.
OutSystems Maps is currently using v3.55, that is available until November 2024.

What was happening

  • Google Maps added the new Maps JavaScript API on version v3.53.2, and the currently version that we are using, v3.55, is the last that the google.maps.Marker is available to use.
  • Google will not remove the code for the Marker class, but highly recommends to use the new AdvancedMarker
  • Differences between Marker (legacy) vs AdvancedMarkerElement
    • The following properties are no longer available → icon, label and location
    • The following methods, of Marker (legacy), no longer exist:
      • getAnimation
      • getClickable
      • getCursor
      • getDraggable
      • getIcon
      • getLabel
      • getMap
      • getOpacity
      • getPosition
      • getPosition
      • getShape
      • getTitle
      • getVisible
      • getZIndex
      • setAnimation
      • setClickable
      • setCursor
      • setDraggable
      • setIcon
      • setLabel
      • setMap
      • setOpacity
      • setOptions
      • setPosition
      • setShape
      • setTitle
      • setVisible
      • setZIndex
    • The following events are no longer available in the provider:
      • animation_changed
      • auxclick
      • clickable_changed
      • contextmenu
      • cursor_changed
      • dblclick
      • draggable_changed
      • flat_changed
      • icon_changed
      • mousedown
      • mouseout
      • mouseover
      • mouseup
      • position_changed
      • rightclick
      • shape_changed
      • title_changed
      • visible_changed
      • zindex_changed
      • ⚠ Events with ❌ were not migrated, and will have no effect. While ✅ were.

What was done

  • Adapted the require changes to the new AdvancedMarker
    • Removed method usage was replaced by newly added properties and getters/setters
    • Changed the way images and labels are added:
      • Now OutSystems Maps builds the HTML:
      • The following CSS classes were added: os-marker-icon and os-marker-icon-label
    • The following events were made available in a different way
      • auxclick
      • contextmenu
      • dblclick
      • mousedown
      • mouseout
      • mouseover
      • mouseup
      • rightclick

Test Steps

  1. Navigate through the test pages, check markers behaviors.

Checklist

  • tested locally
  • documented the code
  • clean all warnings and errors of eslint
  • requires changes in OutSystems (if so, provide a module with changes)
  • requires new sample page in OutSystems (if so, provide a module with changes)

@rugoncalves rugoncalves requested a review from a team as a code owner July 3, 2024 12:05
Copy link

sonarcloud bot commented Jul 3, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants