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-11055: Adding Google Advanced Markers and Map Style Id properties #183

Merged
merged 23 commits into from
Oct 7, 2024

Conversation

rugoncalves
Copy link
Contributor

@rugoncalves rugoncalves commented Oct 2, 2024

This PR is for adding Google Advanced Markers and the ability to use styles created in Google Style Console.

What was happening

With version 3.56, google deprecated the class google.maps.Marker with the following message*:

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.

Additionally, when using the new AdvancedMarkerElement, it become necessary to use the attribute mapId, which is used to indicate the Map Style Id for the styles created in Google Style Console. However, by using it, the current styles stop working, and a new warning is displayed in the console**:

When a mapId is present, Map styles are controlled via the cloud console. 
Please see documentation at https://developers.google.com/maps/documentation/javascript/styling#cloud_tooling

*Consider WARNING1
**Consider WARNING2

What was done

  • Added a new configuration (UseAdvancedMarker) to allow the developer to define which version of the Marker should be used.

  • Added a new configuration (MapStyleId) to allow the developer to pass the style Id as defined in the cloud console:
    image

  • Updated the version of the google maps being used from 3.55 to 3.57 (see version list)

  • Updated the version of OutSystems Maps to 2.0.0

Test Steps

Test 1 - happy path

  1. Enter the test page
  2. And set the following configs for Map 1:
    a. Use Advance Markers: true
    b. Deprecated Style: Standard
  3. Set Show Map (1): true
  4. Result:
  • a map should be displayed with styles coming from the google cloud console
  • no warning in the developer tools

Test 2

  1. Enter the test page
  2. And set the following configs for Map 1:
    a. Use Advance Markers: true
    b. Deprecated Style: Retro
  3. Set Show Map (1): true
  4. Result:
  • a map should be displayed with styles coming from the google cloud console
  • a warning will be displayed in the developer tools: WARNING1

Test 3

  1. Enter the test page
  2. And set the following configs for Map 1:
    a. Use Advance Markers: false
    b. Deprecated Style: Retro
  3. Set Show Map (1): true
  4. Result:
  • a map should be displayed with the Retro styles
  • a warning will be displayed in the developer tools: WARNING2

Test 4

  1. Enter the test page
  2. And set the following configs for Map 1:
    a. Use Advance Markers: true
    b. Deprecated Style: Standard
  3. And set the following configs for Map 2:
    a. Use Advance Markers: false
    b. Deprecated Style: Standard
  4. Set Show Map (1): true
  5. Set Show Map (2): true
  6. Result:
    • Both maps will be displayed
    • Map 1 with google cloud console styles
    • Map 2 with standard styles
    • a warning will be displayed in the developer tools: WARNING1

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 October 2, 2024 15:51
Copy link

sonarqubecloud bot commented Oct 7, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
13.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@rugoncalves rugoncalves merged commit fa0ace1 into dev Oct 7, 2024
9 of 10 checks passed
@rugoncalves rugoncalves deleted the ROU-11055 branch October 7, 2024 13:48
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.

3 participants