我想用JS和VB.NET中的Google Maps API v3製作地圖作爲地圖的服務器端數據陣列。我的地圖隨機加載了出簇,但是當我嘗試在地圖上應用簇時,我的標記變得不可見並且不在地圖上顯示。
這是我製作的地圖,也爲集羣我在地圖上的羣集不起作用
<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
var script = '<script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer';
if (document.location.search.indexOf('compiled') !== -1) {
script += '_compiled';
}
script += '.js"><' + '/script>';
document.write(script);
</script>
<script type="text/javascript">
google.load('maps', '3', {
other_params: 'sensor=false'
});
google.setOnLoadCallback(initialize);
var map;
var markers = [];
var markerClusterer = null;
function initialize() {
var GPS = <%=GPS %>
var map_center = new google.maps.LatLng(31.2330555556,72.3330555556);
var myOptions = {
zoom: 6,
scaleControl:true,
pancontrol: true,
streetViewControl: true,
center: map_center,
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
mapTypeId: google.maps.MapTypeId.HYBRID
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var infowindow = new google.maps.InfoWindow();
var image = 'ico/gn.png';
for(var i=0; i<GPS.length; i++)
{
var marker=new google.maps.Marker({
position:GPS[i].GPS,
draggable:true,
icon:image,
Info: '<table frame=box><tr><td align="Left"><font face="Arial" size=2 color=#336699>Shop Name:</td><td align="Left"><font face="Arial" size=2>'+ GPS[i].SHOP + '</font></td></tr><tr>'+
'<td align="Left"><font face="Arial" size=2 color=#336699>Owner:</td><td align="Left"><font face="Arial" size=2>'+ GPS[i].OWNER + '</font></td></tr>'+
'<td align="Left"><font face="Arial" size=2 color=#336699>Mobile:</td><td align="Left"><font face="Arial" size=2>'+ GPS[i].MOBILE + '</font></td></tr>'+
'<tr><td align="Left"><font face="Arial" size=2 color=#336699>Distributer:</td><td align="Left"><font face="Arial" size=2>'+ GPS[i].DIST + '</font></td></tr><tr>'+
'<tr><td align="Left"><font face="Arial" size=2 color=#336699>Region:</td><td align="Left"><font face="Arial" size=2>'+ GPS[i].REGION + '</font></td></tr>'+
'<tr><td align="Left"></td><td align="Left"><font face="Arial" size=2 color=#336699><a target=_blank href=http://221.120.216.52/elp/sfpl.php?ccode=01&®no='+ GPS[i].REGNO +'>View</a></td></tr>'+
'</table>',
title:GPS[i].SHOP + '(' +GPS[i].DIST + ')'
});
markers.push(marker);
google.maps.event.addListener(markers[i], 'click', function() {
infowindow.setContent(this.Info);
infowindow.open(map,this);
});
}
markerClusterer = new MarkerClusterer(map,markers,
{
maxZoom:5
});
}
</script>
任何代碼?請幫我解決這個問題,並告訴我我的代碼中缺少的是什麼。
任何一個請回答這個問題 – user1397781