Bing Maps optimal zoom - windows-phone-7

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.

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.

Related

Turning off Points of Interest Labels Bing Map AJAX v7.0

I am wondering if there is a way to turn off the labels that appear on the Bing Map labeling things like public beaches or popular businesses? I believe in Google Maps they are called Points of Interest and are simple enough to disable. And I also know I could turn the Labels off completely by disabling that layer using something like this:
map = new Microsoft.Maps.Map(document.getElementById('myMap'), {credentials: 'Your Bing Maps Key', labelOverlay: Microsoft.Maps.LabelOverlay.hidden});
But I want things like street labels so just wondering if I can just select these "Points of Interest" to disable.
Thanks in advance.
The LabelOverlay option is for the map labels in the Aerial imagery. When this is set to hidden and the map is in aerial or birdseye mode you will see the imagery without the labels displayed on the map. There is no option to turn of the point of interest labels as they are drawn right on the map tiles themselves and are not a separate layer of data.

How to show part of a map on a Live Tile in WP7?

I'm developing Windows Phone application using Bing maps, background tasks and live tiles. I'd like to show current neighborhood on a live tile (piece of a map). Is it somehow possible to show part of a map on a tile?
I guess instantiating Map object in background task and rendering part of the map as image won't fit into memory requirements.
Maybe there is a web service for returning map image for target coordinates, zoom and image size?
There is indeed a way to do this through the Virtual Earth service. You can read more about it here.
To summarize, you can get a square tile for a specific location just like this:
http://tiles.virtualearth.net/api/GetMap.ashx?c=39.213413,-98.699930&w=800&h=800&b=r,stl.h,device.mobile,mkt.en-US&z=15&logo=no&da=n

How to define displayed area of map control at startup in wp7?

This might be little bit novice but, how can i set initial displayed area of map control in wp7? I mean, when i changed zoom level from properties, it shows closer look to the map. But i don't know how to make it display europe at startup.
You could use the SetView method of the Map control, passing to it the location you want to center on and a particular zoom level :-
http://msdn.microsoft.com/en-us/library/gg588591(v=vs.92).aspx
http://msdn.microsoft.com/en-us/library/gg588382(v=vs.92).aspx

does bing map control for WP7 provide a feature of "tracking shape manually"?

what I mean is something like this:
http://help.arcgis.com/en/arcgismobile/10.0/apis/WindowsPhone/samples/start.htm
go to that ESRI sample and choose "Graphics" and then choose "Add interactively".
In that sample, you can use mouse(if it's a phone, I suppose we can use fingers) to draw polygons, lines to the top of the map.
does the bing map control for WP7 provide something similar?
Thanks
If the WP7 control is the same as the normal Silverlight control, you can add shapes to your Bing Map by adding MapPolygons(). If not, you can still add polygons and polylines (as well as other shapes) via Silverlight and display it on top.

How to center WP7 Bing Map around a number of pushpins

I am using the RTM WP7 Bing Maps control. I have a number of pushpins at lat/long locations. I want to move and zoom the map to show all the pushpins.
With the Silverlight Bing Maps control I could create a bounding box from a number ot lat/longs and tell the map to zoom using this.
All I can see on the WP7 Bing Maps control is a Center property.
Any ideas how to do this?

Resources