I want to show in a map the markers of all the cities in my database.
I've taken the latitude and longitude from the database of all the
cities and tryed to loop through them to populate de map, but it is
not working.
Can anyone tell me what I'm doing wrong?
<SCRIPT type="text/JavaScript">
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById('map_canvas'));
var center = new GLatLng(0, 0);
map.setCenter(center, 2);
<%
pegaSQL = "select DISTINCT(city), latitude, longitude from registers
order by city"
set pegaRS = oConn.Execute(pegaSQL)
Do Until pegaRS.EOF = True
latitude = pegaRS("latitude" )
longitude = pegaRS("longitude" )
set pegaRS = nothing
Response.Write(" var latlng = new GLatLng("& latitude & ",
"&longitude&");" & vbcrlf)
Response.Write(" map.addOverlay(new GMarker(latlng));" & vbcrlf)
pegaRS.Movenext
Loop
%>
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setMapType(G_HYBRID_MAP);
}
}
</SCRIPT>
Thanks.
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.