如何在google maps v3中将图像添加到标记的InfoWindow?

Sta*_*ton 13 html javascript google-maps

我有一个图像,我想添加到标记,stagleton.png,我有一个创建标记的功能.如何更改InfoWindow方法以使图像也与InfoWindow中的文本一起显示?

function createMarker(name, latlng, mapsent)
{
    var marker = new google.maps.Marker({
                       position: latlng,
                       map: mapsent,
                       title: name   
                       });
    marker.info = new google.maps.InfoWindow({
              //when I add <IMG BORDER="0" ALIGN="Left" SRC="stagleton.jpg"> the maps will not load
      content: <IMG BORDER="0" ALIGN="Left" SRC="stagleton.jpg"> "My name is " + name

    });

    google.maps.event.addListener(marker, 'click', function(){
        marker.info.open(mapsent, marker);
    });
    return marker;
}
Run Code Online (Sandbox Code Playgroud)

Dr.*_*lle 25

尝试:

content: '<IMG BORDER="0" ALIGN="Left" SRC="stagleton.jpg"> My name is ' + name
Run Code Online (Sandbox Code Playgroud)