更新 先生,這是我的網絡page.I的當前代碼根據烏拉圭回合的寶貴意見,但標題是不可見或不顯示什麼由我Assignig服務器端循環變量客戶端陣列
<script runat=server>
Dim mgps As New Text.StringBuilder
Public ReadOnly Property GPS() As String
Get
Return mgps.ToString
End Get
End Property
Dim station As New Text.StringBuilder
Public ReadOnly Property STA() As String
Get
Return station.ToString
End Get
End Property
</script>
<% Dim con As New OleDbConnection
con = New OleDbConnection("Data Source=sml; User ID=sml; Password=sml; provider=OraOLEDB.Oracle")
con.Open()
Dim cmd As OleDbCommand = New OleDbCommand("Select STA_NAME, GPS_ONE from GPS", con)
Dim ds As New DataSet
Dim I As Long
Dim da As New OleDbDataAdapter(cmd)
da.Fill(ds, "GPS")
mgps.AppendLine("[")
For I = 0 To ds.Tables("GPS").Rows.Count - 1
' mgps.AppendLine("new google.maps.LatLng(" & ds.Tables("GPS").Rows(I).Item("GPS_ONE") & "),")
mgps.AppendLine("{GPS:new google.maps.LatLng(" & ds.Tables("GPS").Rows(I).Item("GPS_ONE") & "), Sta_Name:'" & STA & "'},")
Next I
mgps.AppendLine("];")
con.Close()
%>
錯過所做的更改
UPDATE2 和JS代碼是在這裏
for(i=0; i<GPS.length; i++)
{
var image = 'ico/no.png';
var infowindow = new google.maps.InfoWindow();
var ContentString = GPS[i].TITLE
markers[i] = new google.maps.Marker(
{
position: GPS[i].GPS,
map: map,
draggable:true,
icon:image,
title:GPS[i].TITLE
});
google.maps.event.addListener(markers[i], 'click', function() {
infowindow.setContent(ContentString);
infowindow.open(map,markers[i]);
});
}
爵士我的信息窗口不開放什麼可能的問題
GPS_ONE中的數據在您的GPS表中看起來像什麼? – 2011-12-29 13:24:10
它看起來像這樣30.302631872323,73.084871561209 – 2011-12-29 13:25:23
然後根據我的回答下面,它看起來像你缺少新的google.maps.LatLng(部分 – 2011-12-29 13:33:42