多邊形顯示正常,我在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