@@ -39,7 +39,7 @@ async function initMap() {
3939 // [START maps_advanced_markers_graphics_png]
4040 // A marker with a with a URL pointing to a PNG.
4141 const beachFlagImg = document . createElement ( 'img' ) ;
42- beachFlagImg . src = new URL ( './images /beachflag.png' , import . meta. url ) . href ;
42+ beachFlagImg . src = new URL ( './public /beachflag.png' , import . meta. url ) . href ;
4343
4444 const beachFlagMarkerView = new AdvancedMarkerElement ( {
4545 map,
@@ -54,11 +54,11 @@ async function initMap() {
5454
5555 // [START maps_advanced_markers_graphics_svg_glyph]
5656 // A marker with a custom SVG glyph.
57- const glyphImg = document . createElement ( 'img' ) ;
58- glyphImg . src = new URL ( './images/google_logo_g.svg' , import . meta. url ) . href ;
59-
57+ const glyphImgSrc = new URL ( './public/google_logo_g.svg' , import . meta. url ) ;
58+
6059 const glyphSvgPinElement = new PinElement ( {
61- glyph : glyphImg ,
60+ //@ts -ignore
61+ glyphSrc : glyphImgSrc ,
6262 } ) ;
6363
6464 const glyphSvgMarkerView = new AdvancedMarkerElement ( {
@@ -80,7 +80,8 @@ async function initMap() {
8080
8181 const pinElement = new PinElement ( {
8282 background : place . iconBackgroundColor ,
83- glyph : new URL ( String ( place . svgIconMaskURI ) ) ,
83+ //@ts -ignore
84+ glyphSrc : new URL ( String ( place . svgIconMaskURI ) ) ,
8485 } ) ;
8586
8687 const placeIconMarkerView = new AdvancedMarkerElement ( {
@@ -90,25 +91,6 @@ async function initMap() {
9091 title : place . displayName ,
9192 } ) ;
9293 // [END maps_advanced_markers_graphics_place_icon]
93-
94- // [START maps_advanced_markers_graphics_fontawesome]
95- // A marker using a Font Awesome icon for the glyph.
96- const icon = document . createElement ( 'div' ) ;
97- icon . innerHTML = '<i class="fa fa-pizza-slice fa-lg"></i>' ;
98- const faPin = new PinElement ( {
99- glyph : icon ,
100- glyphColor : '#ff8300' ,
101- background : '#FFD514' ,
102- borderColor : '#ff8300' ,
103- } ) ;
104-
105- const faMarker = new AdvancedMarkerElement ( {
106- map,
107- position : { lat : 37.412 , lng : - 122.095829650878 } ,
108- content : faPin . element ,
109- title : 'A marker using a FontAwesome icon for the glyph.'
110- } ) ;
111- // [END maps_advanced_markers_graphics_fontawesome]
11294}
11395
11496initMap ( ) ;
0 commit comments