[Bug] Glyph deprecated warning
Description
Receiving the following warning when rendering a custom <Pin>
The glyph property is deprecated. Please use glyphSrc or glyphText instead.
Steps to Reproduce
Render any JSX.Element inside a Pin:
export function PinWithContent() {
return (
<Pin>
<div className="bg-blue-400">A</div>
</Pin>
);
}
Environment
- Library version: 1.5.5
- Google maps version: weekly
- Browser and Version: Chrome 141.0.7390.108
- OS: Windows 11
Logs
According to https://developers.google.com/maps/documentation/javascript/reference/advanced-markers, PinElement.glyph has been deprecated. It would seem that passing Elements for glyph customization is losing support.
PinElement.glyphSrc only accepts strings and URLs. PinElement.glyphText only accepts strings.
In the latest Version, the PinElement has been implemented as a proper custom element (<gmp-pin>).
This means that the use-case of passing an Elementto the glyph property is now handled by appending children to thegmp-pin`.
This is going to be a slightly bigger refactoring since we want to keep supporting the previous version until it's no longer available.
I already wrote a proof-of-concept for version-switches that allow us to have multiple implementations in the library for different versions of the Google Maps API (we have the same problem with recent updated to the AdvancedMarkerElement).