I have made a .NET control for Google Maps which lets you create
markers easily using .NET code. You can find it at
http://www.reimers.dk
If you use that you can write code like:
foreach(Datarow dr in myDataTable){
GoogleMarker marker = new GoogleMarker();
marker.ID = dr["ID"];
marker.Latitude = (double)dr["Lat"];
marker.Longitude = (double)dr["Lng"];
GoogleMap.Overlays.Add(marker);
}
This will add all the markers in the overlay collection to your map on
load. You can also use it to add marker asynchronously using AJAX.
gh wrote:
Does anyone have an example of how to loop through a table to get the
lat\lon and then pass it to the google map api? I am able to use js to
send one lat\lon to the api and have the map and marker show up on the
web page. I am not sure how or where to do this when looping through a
table.
Thanks