Google Maps custom infobox

前端 未结 3 1308
小蘑菇
小蘑菇 2021-01-14 19:09

I\'m trying to incorporate a custom infobox as per this example but my code just doesn\'t work. Could someone take a look and see where I\'m going wrong?

I\'ve comme

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-14 19:49

    Please make sure that this have property html or not. Since it refers to marker at that time.

    google.maps.event.addListener(marker, "click", function () 
    {
    
        infowindow.setContent(this.html);
        // Call myOptions when marker is clicked and opened
        infowindow.open(map, myOptions, this);
    });
    

    Also try to limit your globals. Please try this Fiddle once.

提交回复
热议问题