ClemensFischer / XAML-Map-Control

XAML Map Control Library
Microsoft Public License
203 stars 59 forks source link

Duplicate SupportedCrs in WmtsTileLayer #58

Closed mennowo closed 4 years ago

mennowo commented 4 years ago

Hello,

while using this WMTS I run into an issue with duplicate items in a dictionary. Specifically, this given WMTS has multiple TileMatrixSets with ""EPSG:3857</ows:SupportedCRS>". This leads to an exception in WmtsTileLayer.cs line 198.

Is this a fault in the WMTS, or something that might be resolved in the library? By changing the code like this:

capabilities.TileMatrixSets.ForEach(s =>
{
  if (!TileMatrixSets.ContainsKey(s.SupportedCrs)) TileMatrixSets.Add(s.SupportedCrs, s);
});

the WMTS functions fine.

Thanks, greets, Menno

ClemensFischer commented 4 years ago

Thanks for spotting that. I have committed a new version of WmtsTileLayer.cs.

I will have to check some other issues before releasing the next NuGet package.