2
votes

I'm developing an app using Silverlight control for Bing Maps.

User can search a location entering a description and pressing a button: Geocode service returns a Location array I use to set map center.

What I'm not able to do is to display map with optimal zoom after search.

I mean, if I search for Italy, map should set mapview to enclose whole Italy; if I search for Venice zoom should be higher and show me the whole city; finally if I search for a street I'd like to see the whole street (if zoom is not too high naturally).

Because of user can zoom in/out before a search, I need to reset zoom everytime... but I didn't find a way to understand which is optimal zoom.

1

1 Answers

2
votes

If you're using Bing geocoding services, I would recommend using the GeocodeResult.BestView property with the MapCore.SetView method.

I can't test it right now, but it should do the job.