Update
Sir this is current code of my web page.I made changes according to ur suggesstion but title is invisible or not displaying what has missed by me
<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
And JS code is here
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]);
});
}
Sir My infowindow is not opening what may the issue
This depends on how you’re storing data in your GPS_ONE column in your GPS table, but if your for loop looks like this:
and the data in your GPS_ONE column looks like this:
then what you wrote should be working.
EDIT: it looks like you’re not creating an array of google map latlng objects as per your example above. Try changing your loop in your vb to look like this:
EDIT for second question:
You can store everything in a JSON object, so
Then you can use this JSON object like this:
Obviously I would recommend renaming your GPS variable to something more suitable because it now holds non-gps data