Renamed TileSource.UriFormat, improved WmtsCapabilities

This commit is contained in:
Clemens 2022-08-23 17:20:16 +02:00
parent 343888be5d
commit 916dc7d4af
13 changed files with 98 additions and 98 deletions

View file

@ -106,7 +106,7 @@ namespace MapControl
TileSource = new BingMapsTileSource
{
UriFormat = imageUrl.Replace("{culture}", Culture),
UriTemplate = imageUrl.Replace("{culture}", Culture),
Subdomains = subdomains
};
}

View file

@ -12,8 +12,7 @@ namespace MapControl
{
Uri uri = null;
if (UriFormat != null && Subdomains != null && Subdomains.Length > 0 &&
x >= 0 && y >= 0 && zoomLevel > 0)
if (UriTemplate != null && Subdomains != null && Subdomains.Length > 0 && zoomLevel > 0)
{
var subdomain = Subdomains[(x + y) % Subdomains.Length];
var quadkey = new char[zoomLevel];
@ -23,7 +22,7 @@ namespace MapControl
quadkey[z] = (char)('0' + 2 * (y % 2) + (x % 2));
}
uri = new Uri(UriFormat
uri = new Uri(UriTemplate
.Replace("{subdomain}", subdomain)
.Replace("{quadkey}", new string(quadkey)));
}

View file

@ -13,7 +13,7 @@ namespace MapControl
{
Uri uri = null;
if (UriFormat != null)
if (UriTemplate != null)
{
var tileSize = 360d / (1 << zoomLevel); // tile width in degrees
var west = MapProjection.Wgs84MeterPerDegree * (x * tileSize - 180d);
@ -21,14 +21,14 @@ namespace MapControl
var south = MapProjection.Wgs84MeterPerDegree * (180d - (y + 1) * tileSize);
var north = MapProjection.Wgs84MeterPerDegree * (180d - y * tileSize);
if (UriFormat.Contains("{bbox}"))
if (UriTemplate.Contains("{bbox}"))
{
uri = new Uri(UriFormat.Replace("{bbox}",
uri = new Uri(UriTemplate.Replace("{bbox}",
string.Format(CultureInfo.InvariantCulture, "{0:F2},{1:F2},{2:F2},{3:F2}", west, south, east, north)));
}
else
{
uri = new Uri(UriFormat
uri = new Uri(UriTemplate
.Replace("{west}", west.ToString("F2", CultureInfo.InvariantCulture))
.Replace("{south}", south.ToString("F2", CultureInfo.InvariantCulture))
.Replace("{east}", east.ToString("F2", CultureInfo.InvariantCulture))

View file

@ -36,7 +36,7 @@ namespace MapControl
/// </summary>
public static MapTileLayer OpenStreetMapTileLayer => new MapTileLayer
{
TileSource = new TileSource { UriFormat = "https://tile.openstreetmap.org/{z}/{x}/{y}.png" },
TileSource = new TileSource { UriTemplate = "https://tile.openstreetmap.org/{z}/{x}/{y}.png" },
SourceName = "OpenStreetMap",
Description = "© [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)"
};

View file

@ -105,7 +105,7 @@ namespace MapControl
Progress.Report(0d);
}
if (Cache == null || tileSource.UriFormat == null || !tileSource.UriFormat.StartsWith("http"))
if (Cache == null || tileSource.UriTemplate == null || !tileSource.UriTemplate.StartsWith("http"))
{
cacheName = null; // no tile caching
}

View file

@ -22,19 +22,19 @@ namespace MapControl
#endif
public class TileSource
{
private string uriFormat;
private string uriTemplate;
/// <summary>
/// Gets or sets the format string to produce tile request Uris.
/// Gets or sets the template string for tile request Uris.
/// </summary>
public string UriFormat
public string UriTemplate
{
get => uriFormat;
get => uriTemplate;
set
{
uriFormat = value;
uriTemplate = value;
if (Subdomains == null && uriFormat != null && uriFormat.Contains("{s}"))
if (Subdomains == null && uriTemplate != null && uriTemplate.Contains("{s}"))
{
Subdomains = new string[] { "a", "b", "c" }; // default OpenStreetMap subdomains
}
@ -53,9 +53,9 @@ namespace MapControl
{
Uri uri = null;
if (UriFormat != null && x >= 0 && y >= 0 && zoomLevel >= 0)
if (UriTemplate != null && x >= 0 && y >= 0 && zoomLevel >= 0)
{
var uriString = UriFormat
var uriString = UriTemplate
.Replace("{x}", x.ToString())
.Replace("{y}", y.ToString())
.Replace("{z}", zoomLevel.ToString());

View file

@ -56,7 +56,7 @@ namespace MapControl
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
return new TileSource { UriFormat = (string)value };
return new TileSource { UriTemplate = (string)value };
}
}
}

View file

@ -328,8 +328,6 @@ namespace MapControl
var uri = ServiceUri.GetLeftPart(UriPartial.Path) + "?"
+ string.Join("&", queryParameters.Select(kv => kv.Key + "=" + kv.Value));
Debug.WriteLine(uri);
return uri.Replace(" ", "%20");
}
}

View file

@ -6,8 +6,8 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Xml.Linq;
using System.Threading.Tasks;
using System.Xml.Linq;
#if !WINUI && !UWP
using System.Windows;
#endif
@ -19,6 +19,10 @@ namespace MapControl
/// </summary>
public class WmtsCapabilities
{
private static readonly XNamespace ows = "http://www.opengis.net/ows/1.1";
private static readonly XNamespace wmts = "http://www.opengis.net/wmts/1.0";
private static readonly XNamespace xlink = "http://www.w3.org/1999/xlink";
public string LayerIdentifier { get; private set; }
public WmtsTileSource TileSource { get; private set; }
public List<WmtsTileMatrixSet> TileMatrixSets { get; private set; }
@ -44,10 +48,7 @@ namespace MapControl
public static WmtsCapabilities ReadCapabilities(XElement capabilitiesElement, string layerIdentifier, string capabilitiesUrl)
{
XNamespace ns = capabilitiesElement.Name.Namespace;
XNamespace ows = "http://www.opengis.net/ows/1.1";
var contentsElement = capabilitiesElement.Element(ns + "Contents");
var contentsElement = capabilitiesElement.Element(wmts + "Contents");
if (contentsElement == null)
{
@ -58,7 +59,7 @@ namespace MapControl
if (!string.IsNullOrEmpty(layerIdentifier))
{
layerElement = contentsElement.Descendants(ns + "Layer")
layerElement = contentsElement.Elements(wmts + "Layer")
.FirstOrDefault(e => e.Element(ows + "Identifier")?.Value == layerIdentifier);
if (layerElement == null)
@ -68,7 +69,7 @@ namespace MapControl
}
else
{
layerElement = capabilitiesElement.Descendants(ns + "Layer").FirstOrDefault();
layerElement = contentsElement.Elements(wmts + "Layer").FirstOrDefault();
if (layerElement == null)
{
@ -78,34 +79,33 @@ namespace MapControl
layerIdentifier = layerElement.Element(ows + "Identifier")?.Value ?? "";
}
var styleElement = layerElement.Descendants(ns + "Style")
var styleElement = layerElement.Elements(wmts + "Style")
.FirstOrDefault(e => e.Attribute("isDefault")?.Value == "true");
if (styleElement == null)
{
styleElement = layerElement.Descendants(ns + "Style").FirstOrDefault();
styleElement = layerElement.Elements(wmts + "Style").FirstOrDefault();
}
var style = styleElement?.Element(ows + "Identifier")?.Value;
var styleIdentifier = styleElement?.Element(ows + "Identifier")?.Value;
if (string.IsNullOrEmpty(style))
if (string.IsNullOrEmpty(styleIdentifier))
{
throw new ArgumentException($"No valid Style element found in Layer \"{layerIdentifier}\".");
throw new ArgumentException($"No Style element found in Layer \"{layerIdentifier}\".");
}
var urlTemplate = ReadUrlTemplate(layerElement, layerIdentifier, style, capabilitiesUrl);
var urlTemplate = ReadUrlTemplate(capabilitiesElement, layerElement, layerIdentifier, styleIdentifier, capabilitiesUrl);
var tileMatrixSetIds = layerElement
.Descendants(ns + "TileMatrixSetLink")
.Select(e => e.Element(ns + "TileMatrixSet")?.Value)
.Where(id => !string.IsNullOrEmpty(id))
.ToList();
.Elements(wmts + "TileMatrixSetLink")
.Select(e => e.Element(wmts + "TileMatrixSet")?.Value)
.Where(id => !string.IsNullOrEmpty(id));
var tileMatrixSets = new List<WmtsTileMatrixSet>();
foreach (var tileMatrixSetId in tileMatrixSetIds)
{
var tileMatrixSetElement = capabilitiesElement.Descendants(ns + "TileMatrixSet")
var tileMatrixSetElement = contentsElement.Elements(wmts + "TileMatrixSet")
.FirstOrDefault(e => e.Element(ows + "Identifier")?.Value == tileMatrixSetId);
if (tileMatrixSetElement == null)
@ -119,19 +119,18 @@ namespace MapControl
return new WmtsCapabilities
{
LayerIdentifier = layerIdentifier,
TileSource = new WmtsTileSource { UriFormat = urlTemplate },
TileSource = new WmtsTileSource { UriTemplate = urlTemplate },
TileMatrixSets = tileMatrixSets
};
}
public static string ReadUrlTemplate(XElement layerElement, string layerIdentifier, string style, string capabilitiesUrl)
public static string ReadUrlTemplate(XElement capabilitiesElement, XElement layerElement, string layerIdentifier, string styleIdentifier, string capabilitiesUrl)
{
XNamespace ns = layerElement.Name.Namespace;
const string formatPng = "image/png";
const string formatJpg = "image/jpeg";
string urlTemplate = null;
var resourceUrls = layerElement.Descendants(ns + "ResourceURL")
var resourceUrls = layerElement.Elements(wmts + "ResourceURL")
.ToLookup(e => e.Attribute("format")?.Value ?? "", e => e.Attribute("template")?.Value ?? "");
if (resourceUrls.Any())
@ -140,39 +139,47 @@ namespace MapControl
: resourceUrls.Contains(formatJpg) ? resourceUrls[formatJpg]
: resourceUrls.First();
urlTemplate = urlTemplates.First().Replace("{Style}", style);
urlTemplate = urlTemplates.First().Replace("{Style}", styleIdentifier);
}
else if (capabilitiesUrl != null &&
capabilitiesUrl.IndexOf("Request=GetCapabilities", StringComparison.OrdinalIgnoreCase) >= 0)
else
{
// no ResourceURL and GetCapabilities KVP request, use GetTile KVP request encoding
var requestUrl = capabilitiesElement
.Elements(ows + "OperationsMetadata")
.Elements(ows + "Operation").Where(e => e.Attribute("name")?.Value == "GetTile")
.Elements(ows + "DCP")
.Elements(ows + "HTTP")
.Elements(ows + "Get").Select(e => e.Attribute(xlink + "href")?.Value)
.FirstOrDefault();
var formats = layerElement.Descendants(ns + "Format").Select(e => e.Value).ToList();
var format = formatPng;
if (formats.Count > 0)
if (requestUrl == null &&
capabilitiesUrl != null &&
capabilitiesUrl.IndexOf("Request=GetCapabilities", StringComparison.OrdinalIgnoreCase) >= 0)
{
format = formats.Contains(formatPng) ? formatPng
: formats.Contains(formatJpg) ? formatJpg
: formats[0];
requestUrl = capabilitiesUrl;
}
urlTemplate = capabilitiesUrl.Split('?')[0]
+ "?Service=WMTS"
+ "&Request=GetTile"
+ "&Version=1.0.0"
+ "&Layer=" + layerIdentifier
+ "&Style=" + style
+ "&Format=" + format
+ "&TileMatrixSet={TileMatrixSet}"
+ "&TileMatrix={TileMatrix}"
+ "&TileRow={TileRow}"
+ "&TileCol={TileCol}";
if (requestUrl != null)
{
var formats = layerElement.Elements(wmts + "Format").Select(e => e.Value);
var format = formats.Contains(formatPng) ? formatPng
: formats.Contains(formatJpg) ? formatJpg
: formats.FirstOrDefault();
if (string.IsNullOrEmpty(format))
{
format = formatPng;
}
urlTemplate = requestUrl.Split('?')[0]
+ "?Service=WMTS&Request=GetTile&Version=1.0.0"
+ "&Layer=" + layerIdentifier + "&Style=" + styleIdentifier + "&Format=" + format
+ "&TileMatrixSet={TileMatrixSet}&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}";
}
}
if (string.IsNullOrEmpty(urlTemplate))
{
throw new ArgumentException($"No valid ResourceURL element found in Layer \"{layerIdentifier}\".");
throw new ArgumentException($"No ResourceURL element in Layer \"{layerIdentifier}\" and no GetTile KVP Operation Metadata found.");
}
return urlTemplate;
@ -180,21 +187,18 @@ namespace MapControl
public static WmtsTileMatrixSet ReadTileMatrixSet(XElement tileMatrixSetElement)
{
XNamespace ns = tileMatrixSetElement.Name.Namespace;
XNamespace ows = "http://www.opengis.net/ows/1.1";
var identifier = tileMatrixSetElement.Element(ows + "Identifier")?.Value;
if (string.IsNullOrEmpty(identifier))
{
throw new ArgumentException("No ows:Identifier element found in TileMatrixSet.");
throw new ArgumentException("No Identifier element found in TileMatrixSet.");
}
var supportedCrs = tileMatrixSetElement.Element(ows + "SupportedCRS")?.Value;
if (string.IsNullOrEmpty(supportedCrs))
{
throw new ArgumentException($"No ows:SupportedCRS element found in TileMatrixSet \"{identifier}\".");
throw new ArgumentException($"No SupportedCRS element found in TileMatrixSet \"{identifier}\".");
}
const string urnPrefix = "urn:ogc:def:crs:EPSG:";
@ -211,7 +215,7 @@ namespace MapControl
var tileMatrixes = new List<WmtsTileMatrix>();
foreach (var tileMatrixElement in tileMatrixSetElement.Descendants(ns + "TileMatrix"))
foreach (var tileMatrixElement in tileMatrixSetElement.Elements(wmts + "TileMatrix"))
{
tileMatrixes.Add(ReadTileMatrix(tileMatrixElement, supportedCrs));
}
@ -226,17 +230,14 @@ namespace MapControl
public static WmtsTileMatrix ReadTileMatrix(XElement tileMatrixElement, string supportedCrs)
{
XNamespace ns = tileMatrixElement.Name.Namespace;
XNamespace ows = "http://www.opengis.net/ows/1.1";
var identifier = tileMatrixElement.Element(ows + "Identifier")?.Value;
if (string.IsNullOrEmpty(identifier))
{
throw new ArgumentException("No ows:Identifier element found in TileMatrix.");
throw new ArgumentException("No Identifier element found in TileMatrix.");
}
var valueString = tileMatrixElement.Element(ns + "ScaleDenominator")?.Value;
var valueString = tileMatrixElement.Element(wmts + "ScaleDenominator")?.Value;
if (string.IsNullOrEmpty(valueString) ||
!double.TryParse(valueString, NumberStyles.Float, CultureInfo.InvariantCulture, out double scaleDenominator))
@ -244,7 +245,7 @@ namespace MapControl
throw new ArgumentException($"No ScaleDenominator element found in TileMatrix \"{identifier}\".");
}
valueString = tileMatrixElement.Element(ns + "TopLeftCorner")?.Value;
valueString = tileMatrixElement.Element(wmts + "TopLeftCorner")?.Value;
string[] topLeftCornerStrings;
if (string.IsNullOrEmpty(valueString) ||
@ -255,28 +256,28 @@ namespace MapControl
throw new ArgumentException($"No TopLeftCorner element found in TileMatrix \"{identifier}\".");
}
valueString = tileMatrixElement.Element(ns + "TileWidth")?.Value;
valueString = tileMatrixElement.Element(wmts + "TileWidth")?.Value;
if (string.IsNullOrEmpty(valueString) || !int.TryParse(valueString, out int tileWidth))
{
throw new ArgumentException($"No TileWidth element found in TileMatrix \"{identifier}\".");
}
valueString = tileMatrixElement.Element(ns + "TileHeight")?.Value;
valueString = tileMatrixElement.Element(wmts + "TileHeight")?.Value;
if (string.IsNullOrEmpty(valueString) || !int.TryParse(valueString, out int tileHeight))
{
throw new ArgumentException($"No TileHeight element found in TileMatrix \"{identifier}\".");
}
valueString = tileMatrixElement.Element(ns + "MatrixWidth")?.Value;
valueString = tileMatrixElement.Element(wmts + "MatrixWidth")?.Value;
if (string.IsNullOrEmpty(valueString) || !int.TryParse(valueString, out int matrixWidth))
{
throw new ArgumentException($"No MatrixWidth element found in TileMatrix \"{identifier}\".");
}
valueString = tileMatrixElement.Element(ns + "MatrixHeight")?.Value;
valueString = tileMatrixElement.Element(wmts + "MatrixHeight")?.Value;
if (string.IsNullOrEmpty(valueString) || !int.TryParse(valueString, out int matrixHeight))
{

View file

@ -14,11 +14,11 @@ namespace MapControl
{
Uri uri = null;
if (UriFormat != null &&
if (UriTemplate != null &&
TileMatrixSet != null && TileMatrixSet.TileMatrixes.Count > zoomLevel &&
x >= 0 && y >= 0 && zoomLevel >= 0)
{
uri = new Uri(UriFormat
uri = new Uri(UriTemplate
.Replace("{TileMatrixSet}", TileMatrixSet.Identifier)
.Replace("{TileMatrix}", TileMatrixSet.TileMatrixes[zoomLevel].Identifier)
.Replace("{TileCol}", x.ToString())

View file

@ -148,7 +148,7 @@
SourceName="OpenStreetMap"
Description="© [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)">
<map:MapTileLayer.TileSource>
<map:TileSource UriFormat="https://tile.openstreetmap.org/{z}/{x}/{y}.png"/>
<map:TileSource UriTemplate="https://tile.openstreetmap.org/{z}/{x}/{y}.png"/>
</map:MapTileLayer.TileSource>
</map:MapTileLayer>
</tools:MapLayerItem>
@ -157,7 +157,7 @@
SourceName="OpenStreetMap German"
Description="© [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)">
<map:MapTileLayer.TileSource>
<map:TileSource UriFormat="https://{s}.tile.openstreetmap.de/{z}/{x}/{y}.png"/>
<map:TileSource UriTemplate="https://{s}.tile.openstreetmap.de/{z}/{x}/{y}.png"/>
</map:MapTileLayer.TileSource>
</map:MapTileLayer>
</tools:MapLayerItem>
@ -166,7 +166,7 @@
SourceName="OpenStreetMap French"
Description="© [OpenStreetMap France](https://www.openstreetmap.fr/mentions-legales/) © [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)">
<map:MapTileLayer.TileSource>
<map:TileSource UriFormat="http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png"/>
<map:TileSource UriTemplate="http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png"/>
</map:MapTileLayer.TileSource>
</map:MapTileLayer>
</tools:MapLayerItem>
@ -175,7 +175,7 @@
SourceName="OpenTopoMap"
Description="© [OpenTopoMap](https://opentopomap.org/) © [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)">
<map:MapTileLayer.TileSource>
<map:TileSource UriFormat="https://tile.opentopomap.org/{z}/{x}/{y}.png"/>
<map:TileSource UriTemplate="https://tile.opentopomap.org/{z}/{x}/{y}.png"/>
</map:MapTileLayer.TileSource>
</map:MapTileLayer>
</tools:MapLayerItem>
@ -206,7 +206,7 @@
<tools:MapLayerItem Text="Seamarks">
<map:MapTileLayer SourceName="Seamarks" MinZoomLevel="9" MaxZoomLevel="18">
<map:MapTileLayer.TileSource>
<map:TileSource UriFormat="http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png"/>
<map:TileSource UriTemplate="http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png"/>
</map:MapTileLayer.TileSource>
</map:MapTileLayer>
</tools:MapLayerItem>

View file

@ -143,7 +143,7 @@
</ProgressBar.Visibility>
</ProgressBar>
<TextBlock Margin="4,2" FontSize="10" local:HyperlinkText.InlinesSource="{Binding Description}"/>
<TextBlock Margin="4,1,4,3" FontSize="10" local:HyperlinkText.InlinesSource="{Binding Description}"/>
</StackPanel>
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Top" Margin="6">
@ -155,7 +155,7 @@
SourceName="OpenStreetMap"
Description="© [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)">
<map:MapTileLayer.TileSource>
<map:TileSource UriFormat="https://tile.openstreetmap.org/{z}/{x}/{y}.png"/>
<map:TileSource UriTemplate="https://tile.openstreetmap.org/{z}/{x}/{y}.png"/>
</map:MapTileLayer.TileSource>
</map:MapTileLayer>
</tools:MapLayerItem>
@ -164,7 +164,7 @@
SourceName="OpenStreetMap German"
Description="© [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)">
<map:MapTileLayer.TileSource>
<map:TileSource UriFormat="https://{s}.tile.openstreetmap.de/{z}/{x}/{y}.png"/>
<map:TileSource UriTemplate="https://{s}.tile.openstreetmap.de/{z}/{x}/{y}.png"/>
</map:MapTileLayer.TileSource>
</map:MapTileLayer>
</tools:MapLayerItem>
@ -173,7 +173,7 @@
SourceName="OpenStreetMap French"
Description="© [OpenStreetMap France](https://www.openstreetmap.fr/mentions-legales/) © [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)">
<map:MapTileLayer.TileSource>
<map:TileSource UriFormat="http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png"/>
<map:TileSource UriTemplate="http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png"/>
</map:MapTileLayer.TileSource>
</map:MapTileLayer>
</tools:MapLayerItem>
@ -182,7 +182,7 @@
SourceName="OpenTopoMap"
Description="© [OpenTopoMap](https://opentopomap.org/) © [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)">
<map:MapTileLayer.TileSource>
<map:TileSource UriFormat="https://tile.opentopomap.org/{z}/{x}/{y}.png"/>
<map:TileSource UriTemplate="https://tile.opentopomap.org/{z}/{x}/{y}.png"/>
</map:MapTileLayer.TileSource>
</map:MapTileLayer>
</tools:MapLayerItem>
@ -190,12 +190,14 @@
<map:WmtsTileLayer
SourceName="TopPlusOpen"
Description="© [BKG](https://gdz.bkg.bund.de/index.php/default/webdienste/topplus-produkte/wmts-topplusopen-wmts-topplus-open.html)"
CapabilitiesUri="https://sgx.geodatenzentrum.de/wmts_topplus_open/1.0.0/WMTSCapabilities.xml"/>
CapabilitiesUri="https://sgx.geodatenzentrum.de/wmts_topplus_open/1.0.0/WMTSCapabilities.xml"
LayerIdentifier="web_light_grau"/>
</tools:MapLayerItem>
<tools:MapLayerItem Text="TopPlusOpen WMS">
<map:WmsImageLayer
Description="© [BKG](https://gdz.bkg.bund.de/index.php/default/webdienste/topplus-produkte/wms-topplusopen-mit-layer-fur-normalausgabe-und-druck-wms-topplus-open.html)"
ServiceUri="https://sgx.geodatenzentrum.de/wms_topplus_open"/>
ServiceUri="https://sgx.geodatenzentrum.de/wms_topplus_open"
Layers="web_grau"/>
</tools:MapLayerItem>
<tools:MapLayerItem Text="OpenStreetMap WMS">
<map:WmsImageLayer
@ -213,7 +215,7 @@
<tools:MapLayerItem Text="Seamarks">
<map:MapTileLayer SourceName="Seamarks" MinZoomLevel="9" MaxZoomLevel="18">
<map:MapTileLayer.TileSource>
<map:TileSource UriFormat="http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png"/>
<map:TileSource UriTemplate="http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png"/>
</map:MapTileLayer.TileSource>
</map:MapTileLayer>
</tools:MapLayerItem>

View file

@ -24,7 +24,7 @@
Description="© [OpenTopoMap](https://opentopomap.org/) © [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)"/>
<map:MapTileLayer
x:Key="Seamarks"
TileSource="http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png"
TileSource="https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png"
SourceName="Seamarks"
MinZoomLevel="9"
MaxZoomLevel="18"/>