views:

77

answers:

0

I have an aspx page that will display a number of locations in a GridView, and want to add a map with markers for each of the locations.

The page will have controls to filter the list, and will probably work by setting the FilterExpression property of the datasource. (Other alternatives welcome)

What is the best way to synchronize the map markers with the list? The best I've come up with so far is to create a DataView from the datasource (in Page_PreRender), iterate thru the rows, and build the appropriate javascript function dynamically - basically adding a new GMarker for each row. I'll also have to keep track of the min. and max. lat and long so I can determine the center.

It seems to me that there must be a better way to do this.