ROU-12677: Cleaning Google Maps Marker console warnings#252
Conversation
There was a problem hiding this comment.
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/elementusage and apply a typings workaround forPinElementOptions. - 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 Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. Pull Request Developer GuidanceQuestions? See the Wiz FAQ. Please contact the Security Office if you encounter issues with Wiz pull request scanning. |
There was a problem hiding this comment.
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
ProviderEventNameswas changed from aclickkey toOnClick. This meansvalidateProviderEvent('click')will now return false and any consumer subscribing to the marker provider event name'click'will be treated as unsupported (and may logEvent 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., keepclickmapped 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.
|



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
<gmp-advanced-marker>: Please use addEventListener('gmp-click', ...) instead of addEventListener('click', ...).<gmp-pin>: The glyph property is deprecated. Please use glyphSrc or glyphText instead.<gmp-pin>: The element property is deprecated. Please use the PinElement directly.What was done
ProviderEventNamesenum inConstants/Marker/Events.tsto use the new'gmp-click'event name instead of'click', aligning with the latest Google Maps event system.Marker.tsto use the new event names fromProviderEventNamesand ensure listeners are properly removed and re-added, preventing duplicate listeners.Helper.Conversions.GetCoordinateValue, ensuring consistent and accurate latitude/longitude values are passed to event handlers.google.maps.marker.PinElementOptionstype mismatch by casting the options object tounknownand then to the expected type, with a TODO note to remove this once type definitions are updated.iconUrlis provided, improving clarity and preventing unnecessary DOM manipulation.Test Steps
Warning 1
Warning 2 & Warning 3
Checklist