I’ve recently downloaded and installed Windows 8 OS along with Visual Studio 2012 and I’m trying to port an old project I built on Windows Phone 7 to WP8.
It has a map that originally had a MapPolygon in it so that whenever you zoom in/out the polygon was always proportional based on the zoom level.
MapPolygon is still a valid class using the new Map control (not Bing Maps Control) but I have no idea how to add it to a map to get the same features/properties.
I think it has to do with the MapElements which should allow to add a shape to the map in the following fashion.
MapPolygon shape = new MapPolygon();
shape.Path.Add(new GeoCoordinate(55.859185825719055, 2.2946083545684877));
shape.Path.Add(new GeoCoordinate(55.858185825719055, 2.2956083545684877));
shape.Path.Add(new GeoCoordinate(55.857185825719055, 2.2946083545684877));
shape.Path.Add(new GeoCoordinate(55.858185825719055, 2.2936083545684877));
shape.StrokeThickness = 3;
shape.StrokeColor = Colors.Blue;
shape.FillColor = Colors.Black;
map1.MapElements.Add(shape);
Nothing shows on the map.
I’ve also tried to add a Grid to a MapOverlay to a MapLayer to a Map but I have no idea how/where to add the MapPolygon in this way.
Ridiculous mistake.
My map wasn’t centered at the same place as the GeoCoordinates were added to the shapes path.