Using map views with Windows Phone

2

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?

    
asked by Don Justo 27.02.2016 в 04:46
source

1 answer

2

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:)

    
answered by 28.02.2016 / 02:21
source