Answered by:
MapIcons in the new Windows 10 Bing map control

Question
-
I have a Windows 8.1 Store App that I am converting to a Windows 10 Universal app. So I went and got a new Bing map key for a Windows universal app. The map displays fine, and I can center it at a specific location and zoom, etc. What I cannot do is have the default MapIcon display at a location.
The code below is the pertinent xaml and C#. Is there something else I should do?
Thanks.
<Maps1:Map Width="500" x:Name="MapControl1" Credentials="xxxxxxx" >
<Maps1:Map.Children>
<Maps1:MapItemsControl x:Name="MapItems1" Visibility="Visible" />
</Maps1:Map.Children>
</Maps1:Map>double Latitude1 = Convert.ToDouble(Photos[lst.SelectedIndex].latitude);
double Longitude1 = Convert.ToDouble(Photos[lst.SelectedIndex].longitude);
MapControl1.Center = new Bing.Maps.Location(Latitude1, Longitude1);
MapControl1.ZoomLevel = 16;MapIcon MapIcon1 = new MapIcon();
MapIcon1.Location = new Geopoint(new BasicGeoposition()
{
Latitude = Latitude1,
Longitude = Longitude1
});MapIcon1.NormalizedAnchorPoint = new Point(0.5, 1.0);
MapIcon1.Title = "Photo Location";
MapIcon1.Visible = true;MapItems1.Items.Add(MapIcon1);MapItems1.Visibility = Visibility.Visible;
MapControl1.MapType = Bing.Maps.MapType.Birdseye;Friday, August 7, 2015 4:45 PM
Answers
-
The bing map windows 10 control that is built into the windows SDK is a merge of the best features from the maps in WP8.1 and the Bing maps windows 8.1 control. MapIcon's were in wp8.1. The windows 8.1 map control should work in win10 as well.
http://rbrundritt.wordpress.com
- Proposed as answer by Ricky_Brundritt Monday, August 10, 2015 4:24 PM
- Marked as answer by Ricky_Brundritt Wednesday, October 21, 2015 12:15 AM
Saturday, August 8, 2015 5:12 PM
All replies
-
OK, I have figured out the solution The problem with using a map in a Windows 10 Universal app was that there appear to be two maps available in visual Studio 2015 if you have worked with maps before. One is the map that is in the toolbox named Map. The other one you may have (as I did in VS 2015 on my main development computer) is the Bing Maps Map. Unfortunately I chose the Bing Map control. It will display a map, but I could never get MapIcons to work. I then discovered the other Map control (Windows.UI.Xaml.Controls.Maps), which is the real Win 10 Map control and from that point on had no trouble placing MapIcons, etc.
Saturday, August 8, 2015 2:41 PM -
The bing map windows 10 control that is built into the windows SDK is a merge of the best features from the maps in WP8.1 and the Bing maps windows 8.1 control. MapIcon's were in wp8.1. The windows 8.1 map control should work in win10 as well.
http://rbrundritt.wordpress.com
- Proposed as answer by Ricky_Brundritt Monday, August 10, 2015 4:24 PM
- Marked as answer by Ricky_Brundritt Wednesday, October 21, 2015 12:15 AM
Saturday, August 8, 2015 5:12 PM -
Thanks for the reply.
I have things working fine now with a MapIcon displaying. I am using whatever control you get from having
xmlns:Maps="using:Windows.UI.Xaml.Controls.Maps"
in the xaml. I believe this is the Win 10 map control.
My current problem is getting such a map to display in the Windows 10 phone emulators. All that displays is the MapIcon, not the base map. That is the case for two of my computers. In one computer, though, the emulators seem to display the map--most of the time. I know that problem existed for the emulators several months back, but I thought the recent emulators had it fixed. But that does not seem to be the case.
Saturday, August 8, 2015 8:45 PM