I have an application in which I need to embed a Map. I know that the control map is from the toolbox. I just do not know how to change the view of the map depending on the type the user wants. Does anyone know how?
I have an application in which I need to embed a Map. I know that the control map is from the toolbox. I just do not know how to change the view of the map depending on the type the user wants. Does anyone know how?
I'm not sure if you mean the Cartographic views. If so, imagine that you have three CheckBox, and for each one you have a different view on your map:
private void Road_Checked(object sender, RoutedEventArgs e)
{
if(MyMap!=null)
MyMap.CartographicMode = MapCartographicMode.Road;
}
private void Aerial_Checked(object sender, RoutedEventArgs e)
{
if(MyMap!=null)
MyMap.CartographicMode = MapCartographicMode.Aerial;
}
private void Hybrid_Checked(object sender, RoutedEventArgs e)
{
if(MyMap!=null)
MyMap.CartographicMode = MapCartographicMode.Hybrid;
}
private void Terrain_Checked(object sender, RoutedEventArgs e)
{
if(MyMap!=null)
MyMap.CartographicMode = MapCartographicMode.Terrain;
}
Also do not forget to add the namespace:
using Microsoft.Phone.Maps.Controls;
I hope you find it useful, if it is. Mark it popcorn:)