多边形显示正常,我在Chrome中调试时看不到任何错误。正在用c#代码查询多边形的数据点,但与此问题无关。当我点击多边形时,js代码似乎在触发,但我没有得到任何信息。我将在接下来的信息泡沫中添加有关多边形的信息,但需要首先让它弹出。任何帮助,将不胜感激!单击多边形时无法弹出信息气泡
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 5,
center: new google.maps.LatLng(30.2979536, -97.7470835),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
<%for(int i = 0; i < this.zips2.Count; ++i)%>
<%{ %>
<%if (layerType == "Orders")
{
GetOrderColor(zips3[i]);
}
else
{
GetAptColor(zips3[i]);
} %>
var paths = [<%=zips2[i]%>];
var color = "<%=color%>";
var shape = new google.maps.Polygon({
paths: paths,
strokeColor: color,
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: color,
fillOpacity: 0.35,
clickable: true
});
shape.setMap(map);
google.maps.event.addListener(shape, 'rightclick', function(event) {
var contentString = '<div id="content:">' + "Test" + '</div>';
infowindow1 = new google.maps.InfoWindow();
infowindow1.setContent(contentString);
infowindow1.open(map, this);
});
<%} %>
的可能重复[我怎么打开每个多边形不同的信息我已经创建了? Google maps api v3](http://stackoverflow.com/questions/13020757/how-do-i-open-different-information-for-each-polygon-ive-created-google-maps-a) – geocodezip 2013-02-13 21:26:19
我还在引用该链接后有相同的问题。该用户能够使信息气泡工作,而不是他们想要的内容。我甚至不能让泡沫显示 – 2013-02-13 21:53:08