diff --git a/MapControl/Shared/MapProjection.cs b/MapControl/Shared/MapProjection.cs index 57efd971..c3330d1c 100644 --- a/MapControl/Shared/MapProjection.cs +++ b/MapControl/Shared/MapProjection.cs @@ -37,7 +37,7 @@ namespace MapControl /// /// Gets the WMS 1.3.0 CRS identifier. /// - public string CrsId { get; protected set; } = string.Empty; + public string CrsId { get; protected set; } = ""; /// /// Gets or sets an optional projection center. diff --git a/MapControl/Shared/WmsImageLayer.cs b/MapControl/Shared/WmsImageLayer.cs index 247811a8..e8b32360 100644 --- a/MapControl/Shared/WmsImageLayer.cs +++ b/MapControl/Shared/WmsImageLayer.cs @@ -31,7 +31,7 @@ namespace MapControl async (layer, oldValue, newValue) => await layer.UpdateImageAsync()); public static readonly DependencyProperty WmsStylesProperty = - DependencyPropertyHelper.Register(nameof(WmsStyles), string.Empty, + DependencyPropertyHelper.Register(nameof(WmsStyles), "", async (layer, oldValue, newValue) => await layer.UpdateImageAsync()); public static readonly DependencyProperty WmsLayersProperty = diff --git a/MapControl/Shared/WmtsCapabilities.cs b/MapControl/Shared/WmtsCapabilities.cs index e19cc3d3..9f6780b2 100644 --- a/MapControl/Shared/WmtsCapabilities.cs +++ b/MapControl/Shared/WmtsCapabilities.cs @@ -84,20 +84,16 @@ namespace MapControl var styleElement = layerElement .Elements(wmts + "Style") - .FirstOrDefault(s => s.Attribute("isDefault")?.Value == "true"); - - if (styleElement == null) - { - styleElement = layerElement - .Elements(wmts + "Style") - .FirstOrDefault(); - } + .FirstOrDefault(s => s.Attribute("isDefault")?.Value == "true") + ?? layerElement + .Elements(wmts + "Style") + .FirstOrDefault(); var style = styleElement?.Element(ows + "Identifier")?.Value; if (string.IsNullOrEmpty(style)) { - throw new ArgumentException($"No Style element found in Layer \"{layer}\"."); + style = "default"; } var urlTemplate = ReadUrlTemplate(capabilitiesElement, layerElement, layer, style, capabilitiesUrl); diff --git a/SampleApps/UniversalApp/MainPage.xaml.cs b/SampleApps/UniversalApp/MainPage.xaml.cs index 12ee83d8..aa065a20 100644 --- a/SampleApps/UniversalApp/MainPage.xaml.cs +++ b/SampleApps/UniversalApp/MainPage.xaml.cs @@ -89,14 +89,14 @@ namespace SampleApplication else { mouseLocation.Visibility = Visibility.Collapsed; - mouseLocation.Text = string.Empty; + mouseLocation.Text = ""; } } private void MapPointerExited(object sender, PointerRoutedEventArgs e) { mouseLocation.Visibility = Visibility.Collapsed; - mouseLocation.Text = string.Empty; + mouseLocation.Text = ""; } private static string GetLatLonText(Location location) diff --git a/SampleApps/WinUiApp/MainWindow.xaml.cs b/SampleApps/WinUiApp/MainWindow.xaml.cs index 8cf65b0e..e0649116 100644 --- a/SampleApps/WinUiApp/MainWindow.xaml.cs +++ b/SampleApps/WinUiApp/MainWindow.xaml.cs @@ -102,14 +102,14 @@ namespace SampleApplication else { mouseLocation.Visibility = Visibility.Collapsed; - mouseLocation.Text = string.Empty; + mouseLocation.Text = ""; } } private void MapPointerExited(object sender, PointerRoutedEventArgs e) { mouseLocation.Visibility = Visibility.Collapsed; - mouseLocation.Text = string.Empty; + mouseLocation.Text = ""; } private static string GetLatLonText(Location location) diff --git a/SampleApps/WpfApplication/MainWindow.xaml.cs b/SampleApps/WpfApplication/MainWindow.xaml.cs index 37bd3a3b..51b6b7f2 100644 --- a/SampleApps/WpfApplication/MainWindow.xaml.cs +++ b/SampleApps/WpfApplication/MainWindow.xaml.cs @@ -94,14 +94,14 @@ namespace SampleApplication else { mouseLocation.Visibility = Visibility.Collapsed; - mouseLocation.Text = string.Empty; + mouseLocation.Text = ""; } } private void MapMouseLeave(object sender, MouseEventArgs e) { mouseLocation.Visibility = Visibility.Collapsed; - mouseLocation.Text = string.Empty; + mouseLocation.Text = ""; } private void MapManipulationInertiaStarting(object sender, ManipulationInertiaStartingEventArgs e)