mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-01 11:05:36 +02:00
Version 4.4.1: MapPolygon for UWP in progress
This commit is contained in:
parent
6b024e2195
commit
946713b8eb
|
|
@ -32,7 +32,7 @@ namespace MapControl
|
||||||
var figures = ((PathGeometry)Data).Figures;
|
var figures = ((PathGeometry)Data).Figures;
|
||||||
figures.Clear();
|
figures.Clear();
|
||||||
|
|
||||||
if (ParentMap != null && Locations != null)
|
if (ParentMap != null && Locations != null && Locations.Count() >= 2)
|
||||||
{
|
{
|
||||||
var locations = Locations;
|
var locations = Locations;
|
||||||
var offset = GetLongitudeOffset();
|
var offset = GetLongitudeOffset();
|
||||||
|
|
@ -43,12 +43,9 @@ namespace MapControl
|
||||||
}
|
}
|
||||||
|
|
||||||
var points = locations.Select(loc => ParentMap.MapProjection.LocationToViewportPoint(loc)).ToList();
|
var points = locations.Select(loc => ParentMap.MapProjection.LocationToViewportPoint(loc)).ToList();
|
||||||
|
points.Add(points[0]);
|
||||||
|
|
||||||
if (points.Count >= 2)
|
CreatePolylineFigures(points);
|
||||||
{
|
|
||||||
points.Add(points[0]);
|
|
||||||
CreatePolylineFigures(points);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ namespace MapControl
|
||||||
{
|
{
|
||||||
((PathGeometry)Data).Figures.Clear();
|
((PathGeometry)Data).Figures.Clear();
|
||||||
|
|
||||||
if (ParentMap != null && Locations != null)
|
if (ParentMap != null && Locations != null && Locations.Count() >= 2)
|
||||||
{
|
{
|
||||||
var locations = Locations;
|
var locations = Locations;
|
||||||
var offset = GetLongitudeOffset();
|
var offset = GetLongitudeOffset();
|
||||||
|
|
@ -43,10 +43,7 @@ namespace MapControl
|
||||||
|
|
||||||
var points = locations.Select(loc => ParentMap.MapProjection.LocationToViewportPoint(loc)).ToList();
|
var points = locations.Select(loc => ParentMap.MapProjection.LocationToViewportPoint(loc)).ToList();
|
||||||
|
|
||||||
if (points.Count >= 2)
|
CreatePolylineFigures(points);
|
||||||
{
|
|
||||||
CreatePolylineFigures(points);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ namespace MapControl
|
||||||
|
|
||||||
if (ParentMap != null && Polygons != null)
|
if (ParentMap != null && Polygons != null)
|
||||||
{
|
{
|
||||||
foreach (var polygon in Polygons.Where(p => p.Any()))
|
foreach (var polygon in Polygons.Where(p => p.Count() >= 2))
|
||||||
{
|
{
|
||||||
var points = polygon.Select(loc => LocationToPoint(loc));
|
var points = polygon.Select(loc => LocationToPoint(loc));
|
||||||
var polyline = new PolyLineSegment(points.Skip(1), true);
|
var polyline = new PolyLineSegment(points.Skip(1), true);
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ namespace MapControl
|
||||||
{
|
{
|
||||||
Data.Figures.Clear();
|
Data.Figures.Clear();
|
||||||
|
|
||||||
if (ParentMap != null && Locations != null && Locations.Any())
|
if (ParentMap != null && Locations != null && Locations.Count() >= 2)
|
||||||
{
|
{
|
||||||
var points = Locations.Select(loc => LocationToPoint(loc));
|
var points = Locations.Select(loc => LocationToPoint(loc));
|
||||||
var polyline = new PolyLineSegment(points.Skip(1), true);
|
var polyline = new PolyLineSegment(points.Skip(1), true);
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ namespace MapControl
|
||||||
{
|
{
|
||||||
Data.Figures.Clear();
|
Data.Figures.Clear();
|
||||||
|
|
||||||
if (ParentMap != null && Locations != null && Locations.Any())
|
if (ParentMap != null && Locations != null && Locations.Count() >= 2)
|
||||||
{
|
{
|
||||||
var points = Locations.Select(loc => LocationToPoint(loc));
|
var points = Locations.Select(loc => LocationToPoint(loc));
|
||||||
var polyline = new PolyLineSegment(points.Skip(1), true);
|
var polyline = new PolyLineSegment(points.Skip(1), true);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue