Changed IMapLayer interface

This commit is contained in:
ClemensFischer 2026-04-09 20:40:14 +02:00
parent 57ee896f8a
commit 1d4c5a4b90
8 changed files with 28 additions and 32 deletions

View file

@ -28,9 +28,15 @@ namespace MapControl.UiTools
protected override bool GetIsEnabled(MapBase map)
{
return map.MapLayer is not IMapLayer mapLayer
|| mapLayer.SupportedCrsIds == null
|| mapLayer.SupportedCrsIds.Contains(CrsId);
var supportedCrsIds = map.MapLayer switch
{
WmsImageLayer wmsImageLayer => wmsImageLayer.SupportedCrsIds,
WmtsTileLayer wmtsTileLayer => wmtsTileLayer.TileMatrixSets.Keys,
MapTileLayer => [WebMercatorProjection.DefaultCrsId],
_ => null
};
return supportedCrsIds == null || supportedCrsIds.Contains(CrsId);
}
protected override bool GetIsChecked(MapBase map)

View file

@ -6,6 +6,7 @@
<DefineConstants>UWP</DefineConstants>
<RootNamespace>MapControl.UiTools</RootNamespace>
<AssemblyTitle>XAML Map Control UI Tools Library for UWP</AssemblyTitle>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DisableRuntimeMarshalling>true</DisableRuntimeMarshalling>
<DefaultLanguage>en-US</DefaultLanguage>
</PropertyGroup>