IMapLayer.SupportedMapProjections

This commit is contained in:
ClemensFischer 2025-09-19 18:49:12 +02:00
parent 046cebb341
commit b5dac4a854
8 changed files with 144 additions and 103 deletions

View file

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
#if WPF
@ -126,6 +127,8 @@ namespace MapControl
/// </summary>
public double LoadingProgress => (double)GetValue(LoadingProgressProperty);
public abstract IReadOnlyCollection<string> SupportedMapProjections { get; }
protected override void SetParentMap(MapBase map)
{
if (map != null)
@ -183,7 +186,11 @@ namespace MapControl
ImageSource image = null;
BoundingBox boundingBox = null;
if (ParentMap != null && ParentMap.ActualWidth > 0d && ParentMap.ActualHeight > 0d)
if (ParentMap != null &&
ParentMap.ActualWidth > 0d &&
ParentMap.ActualHeight > 0d &&
SupportedMapProjections != null &&
SupportedMapProjections.Contains(ParentMap.MapProjection.CrsId))
{
var width = ParentMap.ActualWidth * RelativeImageSize;
var height = ParentMap.ActualHeight * RelativeImageSize;