From 147b56260d120001c16aeb5a9250571b1b0eb82e Mon Sep 17 00:00:00 2001 From: ClemensF Date: Tue, 14 Aug 2018 23:16:10 +0200 Subject: [PATCH] Version 4.10.0: Updated target framework versions. Cleanup of TypeConverters, ImageLoader, MBTileSource. --- MapControl/Shared/ImageLoader.cs | 2 +- MapControl/Shared/MapTileLayer.cs | 4 ++-- MapControl/UWP/Tile.UWP.cs | 6 ++---- MapControl/WPF/Tile.WPF.cs | 6 ++---- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/MapControl/Shared/ImageLoader.cs b/MapControl/Shared/ImageLoader.cs index 5b0f401e..fc2320dc 100644 --- a/MapControl/Shared/ImageLoader.cs +++ b/MapControl/Shared/ImageLoader.cs @@ -34,7 +34,7 @@ namespace MapControl { imageSource = await LoadLocalImageAsync(uri); } - else if (uri.Scheme == "http" || uri.Scheme == "https") + else if (uri.Scheme == "http") { imageSource = await LoadHttpImageAsync(uri); } diff --git a/MapControl/Shared/MapTileLayer.cs b/MapControl/Shared/MapTileLayer.cs index 676cb21b..d9ca85a2 100644 --- a/MapControl/Shared/MapTileLayer.cs +++ b/MapControl/Shared/MapTileLayer.cs @@ -41,7 +41,7 @@ namespace MapControl { SourceName = "OpenStreetMap", Description = "© [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)", - TileSource = new TileSource { UriFormat = "https://{c}.tile.openstreetmap.org/{z}/{x}/{y}.png" }, + TileSource = new TileSource { UriFormat = "http://{c}.tile.openstreetmap.org/{z}/{x}/{y}.png" }, MaxZoomLevel = 19 }; } @@ -374,7 +374,7 @@ namespace MapControl if (equivalentTile != null) { - tile.SetImage(equivalentTile.Image.Source, false); // no fade-in animation + tile.SetImage(equivalentTile.Image.Source, false); // do not animate to avoid flicker when crossing 180° longitude } } diff --git a/MapControl/UWP/Tile.UWP.cs b/MapControl/UWP/Tile.UWP.cs index a8366a53..e0b2aeb4 100644 --- a/MapControl/UWP/Tile.UWP.cs +++ b/MapControl/UWP/Tile.UWP.cs @@ -28,8 +28,7 @@ namespace MapControl } else { - Image.BeginAnimation(UIElement.OpacityProperty, new DoubleAnimation { From = 0d, To = 1d, Duration = FadeDuration, FillBehavior = FillBehavior.Stop }); - Image.Opacity = 1d; + Image.BeginAnimation(UIElement.OpacityProperty, new DoubleAnimation { To = 1d, Duration = FadeDuration }); } } else @@ -47,8 +46,7 @@ namespace MapControl bitmapImage.ImageOpened -= BitmapImageOpened; bitmapImage.ImageFailed -= BitmapImageFailed; - Image.BeginAnimation(UIElement.OpacityProperty, new DoubleAnimation { From = 0d, To = 1d, Duration = FadeDuration, FillBehavior = FillBehavior.Stop }); - Image.Opacity = 1d; + Image.BeginAnimation(UIElement.OpacityProperty, new DoubleAnimation { To = 1d, Duration = FadeDuration }); } private void BitmapImageFailed(object sender, ExceptionRoutedEventArgs e) diff --git a/MapControl/WPF/Tile.WPF.cs b/MapControl/WPF/Tile.WPF.cs index 09ddd05c..27b1663b 100644 --- a/MapControl/WPF/Tile.WPF.cs +++ b/MapControl/WPF/Tile.WPF.cs @@ -28,8 +28,7 @@ namespace MapControl } else { - Image.BeginAnimation(UIElement.OpacityProperty, new DoubleAnimation(0d, 1d, FadeDuration, FillBehavior.Stop)); - Image.Opacity = 1d; + Image.BeginAnimation(UIElement.OpacityProperty, new DoubleAnimation(1d, FadeDuration)); } } else @@ -47,8 +46,7 @@ namespace MapControl bitmapSource.DownloadCompleted -= BitmapDownloadCompleted; bitmapSource.DownloadFailed -= BitmapDownloadFailed; - Image.BeginAnimation(UIElement.OpacityProperty, new DoubleAnimation(0d, 1d, FadeDuration, FillBehavior.Stop)); - Image.Opacity = 1d; + Image.BeginAnimation(UIElement.OpacityProperty, new DoubleAnimation(1d, FadeDuration)); } private void BitmapDownloadFailed(object sender, ExceptionEventArgs e)