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?


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


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}); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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