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?
Related
I am trying to rotate the pushpin image base on the degree for example "120" to show which direction it is going.
var pushpin = new Microsoft.Maps.Pushpin(curlocation, {
icon: '/images/Airplane_icon.png',
anchor: new Microsoft.Maps.Point(20, 20),
color: 'red'
});
It is possible to rotate a pushpin in Bing Maps but requires a bit of code to achieve. There is a code sample here: https://bingmapsv8samples.azurewebsites.net/#Pushpin_RotatedImage This approach would work fine for a few pushpins, but if you have a lot of pushpins that all have difference rotations, or the rotation of a pushpin is updated frequently, this solution likely wouldn't be the best option.
Another consideration is to take a look at Azure Maps which is another Microsoft mapping platform which does support rotating icons on the map. Here is a sample: https://azuremapscodesamples.azurewebsites.net/index.html?sample=Symbol%20Layer%20Options (click on the icon options tab and move the rotation slider). Azure Maps can handle dynamic rotation values on large data sets easily. Here are a couple of related examples: https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20a%20Symbol%20along%20a%20Path
https://azuremapscodesamples.azurewebsites.net/index.html?sample=Add%20Arrow%20along%20a%20Path
I am using Map (Xamarin.Forms.Maps) to display a Google or Bing map. I need images fed to me from a local tilecache to be rendered on top of the map (opacity of images needs to be respected).
If the map control does not support images to display on top I am thinking I might need to display them on top of the map control through some other element and manually update the tilecache requests when the map is zoomed/panned.
Any ideas for how I should go about adding images with opacity to a Xamarin Map would be appreciated. (I could also support different controls for iOS / Android if necessary)
It's possible but you have to write custom renderers on each of your target platforms:
https://developer.xamarin.com/guides/xamarin-forms/custom-renderer/map/
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.
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.
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.