Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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... – 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.