I am currently developing an app for Windows Phone 8 and I encounter some issues due to the asynchronism of all network operations.
I have a list of GeoCoordinate items that I retrieve from an XML file stored on my own website.
These points represent a path that I would like to display on a map.
This list can easily be changed into a list of MapOverlay objects.
However, using
map.Layers.Add(...);
does not help as the list is not built at the moment of the call (the XML loading and reading is asynchronous).
After having a look at the documentation, it looks like a single MapOverlay XAML item can be easily binded to a GeoCoordinate object.
However, I could not find any way to bind a MapLayer XAML item to a collection of GeoCoordinate objects which, I think, would make sense… All the solutions I found on the Internet were only usable for Windows Phone 7.
If anyone has an idea, I would be glad to hear it.
Thanks!
I finally decided to add the overlay through code.
Using events, it is very easy to do and not so ugly.
For those interested in events, this tutorial might be useful: MSDN Events Tutorial