Reputation: 49
I'd like to update my Windows Phone 8.1 app to have the map load in the Aerial style. I have found documentation but how to complete this task still isn't apparent to me. In searching high and low, I've been unable to find a working example. Can someone explain how to set Style/MapStyle here if I simply want to use the Aerial style?
<bm:MapControl MapServiceToken="BLANK" x:Name="myMap" Height="560" Margin="0,0,0,0" Style="" />
Documentation: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn642089.aspx
Upvotes: 0
Views: 544
Reputation: 11
This worked for me:
MainPage.xaml.cs
public MainPage()
{
this.InitializeComponent();
MyMap.Style = MapStyle.AerialWithRoads;
}
Upvotes: 0
Reputation: 11
I got mine to work by setting it in code.
myMap.Style = MapStyle.AerialWithRoads;
or
myMap.Style = MapStyle.Aerial;
Upvotes: 1
Reputation: 1365
When you try to set the Style property in XAML it shows this error:The TypeConverter for "Style" does not support converting from a string.
So you have two options:
Style="{Binding MapStyle}"
Upvotes: 0
Reputation: 49
I wound up figuring this problem out on my own by looking at deprecated examples and fiddling around with the code-behind. I hope that this helps someone else!
Private Sub Page_Load(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
myMap.Style = Maps.MapStyle.Aerial
End Sub
Upvotes: 0