From 91f1960a00f85ed088a243034418e039587015fa Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Sun, 28 Dec 2025 07:30:47 +0100 Subject: [PATCH] Fixed WMS feature info request --- MapControl/Avalonia/MapPolypoint.Avalonia.cs | 4 +-- MapControl/Shared/MapBase.cs | 27 -------------- MapControl/Shared/MapGraticule.cs | 20 +++++------ MapControl/Shared/WmsImageLayer.cs | 38 ++++++++++---------- MapControl/WPF/MapPolypoint.WPF.cs | 4 +-- MapControl/WinUI/MapPolypoint.WinUI.cs | 4 +-- 6 files changed, 34 insertions(+), 63 deletions(-) diff --git a/MapControl/Avalonia/MapPolypoint.Avalonia.cs b/MapControl/Avalonia/MapPolypoint.Avalonia.cs index 05779d43..29ac6b94 100644 --- a/MapControl/Avalonia/MapPolypoint.Avalonia.cs +++ b/MapControl/Avalonia/MapPolypoint.Avalonia.cs @@ -103,8 +103,8 @@ namespace MapControl maxY = Math.Max(maxY, point.Y); } - if (maxX >= 0 && minX <= ParentMap.ActualWidth && - maxY >= 0 && minY <= ParentMap.ActualHeight) + if (maxX >= 0d && minX <= ParentMap.ActualWidth && + maxY >= 0d && minY <= ParentMap.ActualHeight) { var figure = new PathFigure { diff --git a/MapControl/Shared/MapBase.cs b/MapControl/Shared/MapBase.cs index 9c8a381f..c7766b8d 100644 --- a/MapControl/Shared/MapBase.cs +++ b/MapControl/Shared/MapBase.cs @@ -49,8 +49,6 @@ namespace MapControl private Location transformCenter; private Point viewCenter; - private Rect? mapBounds; - private BoundingBox geoBounds; private double centerLongitude; private double maxLatitude = 85.05112878; // default WebMercatorProjection private bool internalPropertyChange; @@ -172,27 +170,6 @@ namespace MapControl set => SetValue(TargetHeadingProperty, value); } - /// - /// Gets the map viewport bounds in projected map coordinates. - /// - public Rect MapBounds - { - get - { - if (!mapBounds.HasValue) - { - mapBounds = ViewRectToMap(0d, 0d, ActualWidth, ActualHeight); - } - - return mapBounds.Value; - } - } - - /// - /// Gets the map viewport bounds in geographic coordinates. - /// - public BoundingBox GeoBounds => geoBounds ??= MapProjection.MapToBoundingBox(MapBounds); - /// /// Gets the ViewTransform instance that is used to transform between projected /// map coordinates and view coordinates. @@ -575,10 +552,6 @@ namespace MapControl protected override void OnViewportChanged(ViewportChangedEventArgs e) { base.OnViewportChanged(e); - - mapBounds = null; - geoBounds = null; - ViewportChanged?.Invoke(this, e); } } diff --git a/MapControl/Shared/MapGraticule.cs b/MapControl/Shared/MapGraticule.cs index ed4b7073..458c5407 100644 --- a/MapControl/Shared/MapGraticule.cs +++ b/MapControl/Shared/MapGraticule.cs @@ -171,14 +171,14 @@ namespace MapControl private void DrawCylindricalGraticule(PathFigureCollection figures, List