mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 06:26:41 +00:00
Simplified WmsImageLayer
This commit is contained in:
parent
6b7fd84c7b
commit
7df36512b8
3 changed files with 80 additions and 71 deletions
|
|
@ -48,7 +48,7 @@ namespace MapControl
|
|||
return image;
|
||||
}
|
||||
|
||||
private DrawingImage GetImage(MapProjection projection, Rect rect, IEnumerable<IMapDrawingItem> items)
|
||||
private DrawingImage GetImage(MapProjection projection, Rect mapRect, IEnumerable<IMapDrawingItem> items)
|
||||
{
|
||||
var scale = ParentMap.ViewTransform.Scale;
|
||||
var rotation = ParentMap.ViewTransform.Rotation;
|
||||
|
|
@ -62,13 +62,13 @@ namespace MapControl
|
|||
.Select(point => point.Value)
|
||||
.ToList();
|
||||
|
||||
if (points.Any(point => rect.Contains(point)))
|
||||
if (points.Any(point => mapRect.Contains(point)))
|
||||
{
|
||||
for (int i = 0; i < points.Count; i++)
|
||||
{
|
||||
points[i] = new Point(
|
||||
scale * (points[i].X - rect.X),
|
||||
scale * ((rect.Y + rect.Height) - points[i].Y));
|
||||
scale * (points[i].X - mapRect.X),
|
||||
scale * ((mapRect.Y + mapRect.Height) - points[i].Y));
|
||||
}
|
||||
|
||||
drawings.Children.Add(item.GetDrawing(points, scale, rotation));
|
||||
|
|
@ -79,7 +79,7 @@ namespace MapControl
|
|||
{
|
||||
Drawing = drawings,
|
||||
ViewboxUnits = BrushMappingMode.Absolute,
|
||||
Viewbox = new Rect(0, 0, scale * rect.Width, scale * rect.Height),
|
||||
Viewbox = new Rect(0, 0, scale * mapRect.Width, scale * mapRect.Height),
|
||||
};
|
||||
|
||||
var drawing = new GeometryDrawing(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue