react-google-maps icon indicating copy to clipboard operation
react-google-maps copied to clipboard

[Bug] Glyph deprecated warning

Open wadeamaral opened this issue 4 months ago • 2 comments

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


wadeamaral avatar Oct 22 '25 03:10 wadeamaral

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.

ellezhu1 avatar Nov 11 '25 23:11 ellezhu1

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).

usefulthink avatar Nov 12 '25 18:11 usefulthink