Wednesday, 15 August 2012

c# - Bing Map on Windows Phone 8.1 -



c# - Bing Map on Windows Phone 8.1 -

i'm trying alter viewport of map within windows phone 8.1 app. have set center (that works) , lowerleft/upperright coordinates set bounds of map, have zoomlevel property can't help me set bounds of map precision.

this have:

xaml

xmlns:maps="using:windows.ui.xaml.controls.maps" ... <maps:mapcontrol x:name="mymap" mapservicetoken="<token>"/>

code

this.mymap.center = new geopoint(new basicgeoposition() { latitude = 46.85, longitude = 8.94});

now want set upperright , lowerleft corner set bounds. saw article here doesn't work me.. convertgeocoordinatetoviewportpoint doesn't exist namespace windows.ui.xaml.controls.maps , don't know why.

thank you.

you have specific method set bounds of current mapcontrol trysetviewboundsasync, see:

http://msdn.microsoft.com/en-us/library/windowsphone/develop/dn637065.aspx

and might interested in geoboundingbox class:

http://msdn.microsoft.com/en-us/library/windowsphone/develop/windows.devices.geolocation.geoboundingbox.aspx

and here illustration (map mapcontrol):

list<basicgeoposition> basicpositions = new list<basicgeoposition>(); basicpositions.add(new basicgeoposition() { latitude = 50, longitude = 3 }); basicpositions.add(new basicgeoposition() { latitude = 55, longitude = 8 }); basicpositions.add(new basicgeoposition() { latitude = 42, longitude = 0 }); this.map.trysetviewboundsasync(geoboundingbox.trycompute(basicpositions), null, mapanimationkind.default);

c# bing-maps windows-phone-8.1

No comments:

Post a Comment