Skip to content

Commit 7712dff

Browse files
authored
feat: Adds an example to demo substituting a text character for the pin glyph. (#1805)
1 parent 86856fd commit 7712dff

File tree

1 file changed

+15
-3
lines changed
  • samples/advanced-markers-basic-style

1 file changed

+15
-3
lines changed

samples/advanced-markers-basic-style/index.ts

+15-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ async function initMap() {
6060
});
6161
const markerViewBorder = new AdvancedMarkerElement({
6262
map,
63-
position: { lat: 37.415, lng: -122.03 },
63+
position: { lat: 37.415, lng: -122.035 },
6464
content: pinBorder.element,
6565
});
6666
// [END maps_advanced_markers_basic_style_border]
@@ -72,19 +72,31 @@ async function initMap() {
7272
});
7373
const markerViewGlyph = new AdvancedMarkerElement({
7474
map,
75-
position: { lat: 37.415, lng: -122.02 },
75+
position: { lat: 37.415, lng: -122.025 },
7676
content: pinGlyph.element,
7777
});
7878
// [END maps_advanced_markers_basic_style_glyph]
7979

80+
// [START maps_advanced_markers_basic_style_text_glyph]
81+
const pinTextGlyph = new PinElement({
82+
glyph: 'T',
83+
glyphColor: 'white',
84+
});
85+
const markerViewGlyphText = new AdvancedMarkerElement({
86+
map,
87+
position: { lat: 37.415, lng: -122.015 },
88+
content: pinTextGlyph.element,
89+
});
90+
// [END maps_advanced_markers_basic_style_text_glyph]
91+
8092
// [START maps_advanced_markers_basic_style_hide_glyph]
8193
// Hide the glyph.
8294
const pinNoGlyph = new PinElement({
8395
glyph: '',
8496
});
8597
const markerViewNoGlyph = new AdvancedMarkerElement({
8698
map,
87-
position: { lat: 37.415, lng: -122.01 },
99+
position: { lat: 37.415, lng: -122.005 },
88100
content: pinNoGlyph.element,
89101
});
90102
// [END maps_advanced_markers_basic_style_hide_glyph]

0 commit comments

Comments
 (0)