mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-02 03:28:06 +02:00
Updated MapPolypoint
This commit is contained in:
parent
e4048db274
commit
2b3a8606c0
|
|
@ -81,7 +81,10 @@ namespace MapControl
|
||||||
|
|
||||||
private void AddPolylinePoints(PathFigures figures, IEnumerable<Location> locations, double longitudeOffset, bool closed)
|
private void AddPolylinePoints(PathFigures figures, IEnumerable<Location> locations, double longitudeOffset, bool closed)
|
||||||
{
|
{
|
||||||
var points = LocationsToView(locations, longitudeOffset);
|
var points = locations
|
||||||
|
.Select(location => LocationToView(location, longitudeOffset))
|
||||||
|
.Where(point => point.HasValue)
|
||||||
|
.Select(point => point.Value);
|
||||||
|
|
||||||
if (points.Any())
|
if (points.Any())
|
||||||
{
|
{
|
||||||
|
|
@ -120,8 +123,8 @@ namespace MapControl
|
||||||
{
|
{
|
||||||
if (figures.Count == 0)
|
if (figures.Count == 0)
|
||||||
{
|
{
|
||||||
// Avalonia Shape seems to ignore PathGeometry with empty Figures collection
|
// Avalonia Shape seems to ignore PathGeometry with empty Figures collection.
|
||||||
|
//
|
||||||
figures.Add(new PathFigure { StartPoint = new Point(-1000, -1000) });
|
figures.Add(new PathFigure { StartPoint = new Point(-1000, -1000) });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using System.Collections.Generic;
|
#if WPF
|
||||||
using System.Linq;
|
|
||||||
#if WPF
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
#elif UWP
|
#elif UWP
|
||||||
using Windows.UI.Xaml;
|
using Windows.UI.Xaml;
|
||||||
|
|
@ -123,21 +121,5 @@ namespace MapControl
|
||||||
|
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IEnumerable<Point> LocationsToMap(IEnumerable<Location> locations, double longitudeOffset)
|
|
||||||
{
|
|
||||||
return locations
|
|
||||||
.Select(location => LocationToMap(location, longitudeOffset))
|
|
||||||
.Where(point => point.HasValue)
|
|
||||||
.Select(point => point.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected IEnumerable<Point> LocationsToView(IEnumerable<Location> locations, double longitudeOffset)
|
|
||||||
{
|
|
||||||
return locations
|
|
||||||
.Select(location => LocationToView(location, longitudeOffset))
|
|
||||||
.Where(point => point.HasValue)
|
|
||||||
.Select(point => point.Value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -330,7 +330,7 @@ namespace MapControl
|
||||||
{ "J", Math.Round(imagePos.Y).ToString("F0") }
|
{ "J", Math.Round(imagePos.Y).ToString("F0") }
|
||||||
};
|
};
|
||||||
|
|
||||||
// GetRequestUri may modify queryParameters["LAYERS"]
|
// GetRequestUri may modify queryParameters["LAYERS"].
|
||||||
//
|
//
|
||||||
uri = GetRequestUri(queryParameters) + "&QUERY_LAYERS=" + queryParameters["LAYERS"];
|
uri = GetRequestUri(queryParameters) + "&QUERY_LAYERS=" + queryParameters["LAYERS"];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,10 @@ namespace MapControl
|
||||||
|
|
||||||
private void AddPolylinePoints(StreamGeometryContext context, IEnumerable<Location> locations, double longitudeOffset, bool closed)
|
private void AddPolylinePoints(StreamGeometryContext context, IEnumerable<Location> locations, double longitudeOffset, bool closed)
|
||||||
{
|
{
|
||||||
var points = LocationsToView(locations, longitudeOffset);
|
var points = locations
|
||||||
|
.Select(location => LocationToView(location, longitudeOffset))
|
||||||
|
.Where(point => point.HasValue)
|
||||||
|
.Select(point => point.Value);
|
||||||
|
|
||||||
if (points.Any())
|
if (points.Any())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,10 @@ namespace MapControl
|
||||||
|
|
||||||
private void AddPolylinePoints(PathFigureCollection figures, IEnumerable<Location> locations, double longitudeOffset, bool closed)
|
private void AddPolylinePoints(PathFigureCollection figures, IEnumerable<Location> locations, double longitudeOffset, bool closed)
|
||||||
{
|
{
|
||||||
var points = LocationsToView(locations, longitudeOffset);
|
var points = locations
|
||||||
|
.Select(location => LocationToView(location, longitudeOffset))
|
||||||
|
.Where(point => point.HasValue)
|
||||||
|
.Select(point => point.Value);
|
||||||
|
|
||||||
if (points.Any())
|
if (points.Any())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue