我创建了一个标记,并在该标记上添加了一个监听器,该监听器将打开一个信息窗口。我的问题是我不知道如何更改信息窗口的默认框架。是否可以?这是我的代码:
var markerPosition = new google.maps.LatLng(lat, lng);
var shopMarker = new google.maps.Marker({
position: markerPosition,
map: map,
icon: iconshop,
title: " shop",
draggable: false
});
var content = '<ul class="shopmaplist"> <li>text</li>'
+'<li><span>text</span>text</li>'
+'</ul><ul class="shoplistel">text</ul></br>'
+'<div class="buttonshop"><input type="submit" class="btncontinue" value="text" tabindex="3"></div>';
var infowindow = new google.maps.InfoWindow();
google.maps.event.addListener(shopMarker,'click', (function(shopMarker,content,infowindow){
return function() {
infowindow.setContent(content);
infowindow.open(map,shopMarker);
};
})(shopMarker,content,infowindow));
在这段代码中,我可以做什么来自定义 infoWindow 的框架和一般样式?
编辑: 下图是我点击标记时想要的结果。
最佳答案
您无法更改 google.maps.InfoWindow 。您可以使用“第 3 方”InfoWindow 替代品,例如 InfoBubble或InfoBox甚至创建您自己的custom overlay
关于javascript - 谷歌地图 : Change infoWindow's Frame,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25081942/