After the Windows 10 Creators upgrade (build 15063), the MapControl children in my UWP app aren't fixed on the map anymore when moving or zooming the map itself. From a specific zoomlevel, I noticed a difference in behaviour when zooming on the map. From that point there is a visual 'globe' effect notable. Difficult to describe, but the map isn't pure flat (2D) in my opinion.
See here the desired output on build 14393, as you can see the radar overlay stays on the same position when moving or zooming the map: Image: https://www.regenthetin.nl/files/desired_behaviour_v14393.gif
Undesired output on build 15063, the overlay moves slowly with the map: Image: https://www.regenthetin.nl/files/undesired_behaviour_v15063.gif
Responsible code blocks:
Snippet 1
// Add children to MapControl at specified location
var radarImgPosition = new Geopoint(new BasicGeoposition()
{
Latitude = 59.60,
Longitude = -12.00
});
RadarMap.Children.Clear();
if (RadarMap.Children.Count == 0)
{
RadarMap.Children.Add(radarImg);
MapControl.SetLocation(radarImg, radarImgPosition);
}
Snippet 2
private void RadarMap_ZoomLevelChanged(MapControl sender, object args)
{
Windows.Foundation.Point southWestPoint;
RadarMap.GetOffsetFromLocation(new Geopoint(new BasicGeoposition()
{
Longitude = -11.9687,
Latitude = 46.9106
}), out southWestPoint);
Windows.Foundation.Point northEastPoint;
RadarMap.GetOffsetFromLocation(new Geopoint(new BasicGeoposition()
{
Longitude = 15.5080,
Latitude = 60.0247
}), out northEastPoint);
double radarImgWidth = northEastPoint.X - southWestPoint.X;
double radarImgHeight = Math.Abs(northEastPoint.Y - southWestPoint.Y);
DisplayInformation displayInformation = DisplayInformation.GetForCurrentView();
double scaleValue = (displayInformation.RawPixelsPerViewPixel * 100.0);
radarImg.Height = (radarImgHeight) / (scaleValue / 100);
radarImg.Width = (radarImgWidth) / (scaleValue / 100);
}
I've investigated in it for several hours, but I didn't find a solution so far. I hope someone can help me!
Dev config: Visual Studio 2017 i.c.m. Windows 10 Creators update SDK.