mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Removed string.Empty
This commit is contained in:
parent
e67d7ee1e3
commit
37b3809b8f
6 changed files with 13 additions and 17 deletions
|
|
@ -37,7 +37,7 @@ namespace MapControl
|
|||
/// <summary>
|
||||
/// Gets the WMS 1.3.0 CRS identifier.
|
||||
/// </summary>
|
||||
public string CrsId { get; protected set; } = string.Empty;
|
||||
public string CrsId { get; protected set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an optional projection center.
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ namespace MapControl
|
|||
async (layer, oldValue, newValue) => await layer.UpdateImageAsync());
|
||||
|
||||
public static readonly DependencyProperty WmsStylesProperty =
|
||||
DependencyPropertyHelper.Register<WmsImageLayer, string>(nameof(WmsStyles), string.Empty,
|
||||
DependencyPropertyHelper.Register<WmsImageLayer, string>(nameof(WmsStyles), "",
|
||||
async (layer, oldValue, newValue) => await layer.UpdateImageAsync());
|
||||
|
||||
public static readonly DependencyProperty WmsLayersProperty =
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue