Skip to content

ROU-12677: Cleaning Google Maps Marker console warnings#252

Merged
rugoncalves merged 8 commits intodevfrom
ROU-12677
Apr 2, 2026
Merged

ROU-12677: Cleaning Google Maps Marker console warnings#252
rugoncalves merged 8 commits intodevfrom
ROU-12677

Conversation

@rugoncalves
Copy link
Copy Markdown
Contributor

This PR is for updating the code, according to google's recommendation, avoiding warnings to appear in the console. Additionally, the changes include updating event names to match Google Maps' new event system, refactoring event listener logic, and applying a workaround for type definition mismatches with PinElementOptions.

What was happening

  • The console was displaying warnings coming from Google Maps framework:
    • Warning 1: <gmp-advanced-marker>: Please use addEventListener('gmp-click', ...) instead of addEventListener('click', ...).
    • Warning 2: <gmp-pin>: The glyph property is deprecated. Please use glyphSrc or glyphText instead.
    • Warning 3: <gmp-pin>: The element property is deprecated. Please use the PinElement directly.
  • The warnings were caused by the usage of deprecated properties.

What was done

  • To solve Warning 1: 297e58d
    • Updated the ProviderEventNames enum in Constants/Marker/Events.ts to use the new 'gmp-click' event name instead of 'click', aligning with the latest Google Maps event system.
    • Refactored marker event listener registration in Marker.ts to use the new event names from ProviderEventNames and ensure listeners are properly removed and re-added, preventing duplicate listeners.
    • Standardized coordinate extraction in event callbacks by using Helper.Conversions.GetCoordinateValue, ensuring consistent and accurate latitude/longitude values are passed to event handlers.
  • To solve Warning 2 : 9fc691a
    • Implemented a temporary workaround for the google.maps.marker.PinElementOptions type mismatch by casting the options object to unknown and then to the expected type, with a TODO note to remove this once type definitions are updated.
  • To solve Warning 3: 2ca30cf
    • Implemented a change where the PinElement is passed directly to the provider content property;
  • General improvement: e53c318
    • Adjusted the conditional logic for rendering marker icons to ensure that a custom icon is only created when iconUrl is provided, improving clarity and preventing unnecessary DOM manipulation.

Test Steps

  • Warning 1

    1. Enter test page "Google_Marker_Block";
    2. Open the developer tools, and look into the console ;
    3. Validate if Warning 1 appears;
  • Warning 2 & Warning 3

    1. Enter test page "DrawingTools";
    2. Open the developer tools;
    3. Click on the Marker drawing tool;
    4. Add a marker to the map;
    5. Look into the console and validate if Warning 2 and/or Warning 3 appear;

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)

Copilot AI review requested due to automatic review settings March 30, 2026 13:58
@rugoncalves rugoncalves requested a review from a team as a code owner March 30, 2026 13:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Google Maps marker implementation to align with Google’s newer Advanced Marker / PinElement APIs, aiming to remove console deprecation warnings and standardize marker event handling.

Changes:

  • Updates marker icon rendering to avoid deprecated glyph / element usage and apply a typings workaround for PinElementOptions.
  • Refactors marker event registration to use the new Google event name (gmp-click) and standardizes coordinate extraction.
  • Updates Google marker provider event constants to reflect the new event system.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Providers/Maps/Google/Marker/Marker.ts Refactors icon creation (PinElement) and rewires marker event listener registration/cleanup.
src/Providers/Maps/Google/Constants/Marker/Events.ts Updates provider event-name mapping for Google marker events (notably click).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wiz-code-outsystems
Copy link
Copy Markdown

wiz-code-outsystems bot commented Mar 30, 2026

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total -

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

Pull Request Developer Guidance

Questions? See the Wiz FAQ.

Please contact the Security Office if you encounter issues with Wiz pull request scanning.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/Providers/Maps/Google/Constants/Marker/Events.ts:11

  • ProviderEventNames was changed from a click key to OnClick. This means validateProviderEvent('click') will now return false and any consumer subscribing to the marker provider event name 'click' will be treated as unsupported (and may log Event click is not a valid event for the Marker.). If the intent is only to change the emitted DOM/provider event name, consider keeping a backwards-compatible alias (e.g., keep click mapped to 'gmp-click', or support both keys) so existing integrations don’t break and behavior stays consistent with the Leaflet provider constants.
	export enum ProviderEventNames {
		OnClick = 'gmp-click',
		drag = 'drag',
		dragend = 'dragend',
		dragstart = 'dragstart',
	}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 2, 2026

@rugoncalves rugoncalves merged commit 1a53a98 into dev Apr 2, 2026
16 checks passed
@rugoncalves rugoncalves deleted the ROU-12677 branch April 2, 2026 15:52
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.

4 participants