0
私はasp.netでGoogleマップのマルチマーカーで作業しています。ここではサーバー側からクライアント側の変数に配列値を送信する必要があります。私はクライアント側変数に配列を渡すために "ClientScript.RegisterArrayDeclaration"を使用しています。しかし、それは動作しません。親切に私を助けてください。私はページの負荷に価値を渡す必要があります。 "場所は" 私のJavaスクリプトは *私はasp.netでGoogleマップのマルチマーカーで作業しています
<html>
<head>
<title>Google Maps Multiple Markers</title>
<script src="http://maps.google.com/maps/api/js?key=My KEy" type="text/javascript"></script>
</head>
<body>
<center>
<div id="map" style="height: 500px; width: 700px;">
</div>
</center>
<script type="text/javascript">
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 8,
center: new google.maps.LatLng(9.918648010, 78.12000),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var infowindow = new google.maps.InfoWindow();
var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});
google.maps.event.addListener(marker, 'click', (function (marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
}
</script>
</body>
</html>
*
protected void Page_Load(object sender, EventArgs e)
{
List<String> oGeocodeList = new List<String>
{
" ['Bala', 9.91864810526, 78.1203081843780, 4] ",
" ['ganesh', 9.91864, 78.12, 5] ",
" ['santhosh', 9.9186, 78.120, 3] ",
" ['test', 9.9186481, 78.12030, 2] ",
" ['test2', 9.918670, 78.12840, 1] "
};
var geocodevalues = string.Join(",", oGeocodeList.ToArray());
ClientScript.RegisterArrayDeclaration("locations", geocodevalues);
}