Skip to content

Commit

Permalink
feat: Adds an example to demo substituting a text character for the p…
Browse files Browse the repository at this point in the history
…in glyph. (#1805)
  • Loading branch information
willum070 authored Aug 29, 2024
1 parent 86856fd commit 7712dff
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions samples/advanced-markers-basic-style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async function initMap() {
});
const markerViewBorder = new AdvancedMarkerElement({
map,
position: { lat: 37.415, lng: -122.03 },
position: { lat: 37.415, lng: -122.035 },
content: pinBorder.element,
});
// [END maps_advanced_markers_basic_style_border]
Expand All @@ -72,19 +72,31 @@ async function initMap() {
});
const markerViewGlyph = new AdvancedMarkerElement({
map,
position: { lat: 37.415, lng: -122.02 },
position: { lat: 37.415, lng: -122.025 },
content: pinGlyph.element,
});
// [END maps_advanced_markers_basic_style_glyph]

// [START maps_advanced_markers_basic_style_text_glyph]
const pinTextGlyph = new PinElement({
glyph: 'T',
glyphColor: 'white',
});
const markerViewGlyphText = new AdvancedMarkerElement({
map,
position: { lat: 37.415, lng: -122.015 },
content: pinTextGlyph.element,
});
// [END maps_advanced_markers_basic_style_text_glyph]

// [START maps_advanced_markers_basic_style_hide_glyph]
// Hide the glyph.
const pinNoGlyph = new PinElement({
glyph: '',
});
const markerViewNoGlyph = new AdvancedMarkerElement({
map,
position: { lat: 37.415, lng: -122.01 },
position: { lat: 37.415, lng: -122.005 },
content: pinNoGlyph.element,
});
// [END maps_advanced_markers_basic_style_hide_glyph]
Expand Down

0 comments on commit 7712dff

Please sign in to comment.