From f1c1508e97788397fe9624c6c37f9feca6eecf3f Mon Sep 17 00:00:00 2001 From: ClemensF Date: Tue, 26 Jan 2021 00:25:57 +0100 Subject: [PATCH] Update MapItemsImageLayer.WPF.cs --- MapControl/WPF/MapItemsImageLayer.WPF.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MapControl/WPF/MapItemsImageLayer.WPF.cs b/MapControl/WPF/MapItemsImageLayer.WPF.cs index 02b4faa6..2312fa52 100644 --- a/MapControl/WPF/MapItemsImageLayer.WPF.cs +++ b/MapControl/WPF/MapItemsImageLayer.WPF.cs @@ -51,11 +51,11 @@ namespace MapControl foreach (var item in items) { - var positions = item.Locations.Select(l => projection.LocationToMap(l)).ToArray(); + var positions = item.Locations.Select(l => projection.LocationToMap(l)).ToList(); if (positions.Any(p => mapRect.Contains(p))) { - for (int i = 0; i < positions.Length; i++) + for (int i = 0; i < positions.Count; i++) { positions[i] = new Point( scale * (positions[i].X - mapRect.X), @@ -66,8 +66,9 @@ namespace MapControl } } - var drawingBrush = new DrawingBrush(drawings) + var drawingBrush = new DrawingBrush { + Drawing = drawings, ViewboxUnits = BrushMappingMode.Absolute, Viewbox = new Rect(0, 0, scale * mapRect.Width, scale * mapRect.Height), };