Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

If I have a MapLayer that I'm applying to Bing Maps where I have a list of coordinates, how can I zoom to see the full MapLayer (dynamically zoom to the proper size) and toggle between seeing the starting point and ending point?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Use setView(LocationRect rect) in the Map to zoom. I would guess that MapLayer.GetPositionRectangle(layer) would give the full extent of the layer but I'm not sure. Otherwise loop through the list and create the LocationRect. For panning to different locations use the SetView(GeoCoordinate center, double zoomLevel) using the map ZoomLevel

share|improve this answer
I figured that out earlier today. Thanks! –  Jason N. Gaylord Jun 22 '11 at 4:36

The BING Maps API - Interactive SDK for v7 is useful for finding out how the zoom to works


The Zoom to Polygons seems to be

map.setView( {zoom:10}); 
share|improve this answer
That sample is for the Bing maps AJAX controls, the question was on the Silverlight WP7 controls... msdn.microsoft.com/en-us/library/ff955762.aspx –  MathiasWestin Jun 22 '11 at 6:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.