mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Update MapGraticule.WPF.cs
This commit is contained in:
parent
4146db12e6
commit
e650c9081f
|
|
@ -50,7 +50,6 @@ namespace MapControl
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// todo
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -63,14 +62,14 @@ namespace MapControl
|
||||||
var latLabels = new List<Label>((int)((boundingBox.North - latLabelStart) / lineDistance) + 1);
|
var latLabels = new List<Label>((int)((boundingBox.North - latLabelStart) / lineDistance) + 1);
|
||||||
var lonLabels = new List<Label>((int)((boundingBox.East - lonLabelStart) / lineDistance) + 1);
|
var lonLabels = new List<Label>((int)((boundingBox.East - lonLabelStart) / lineDistance) + 1);
|
||||||
var typeface = new Typeface(FontFamily, FontStyle, FontWeight, FontStretch);
|
var typeface = new Typeface(FontFamily, FontStyle, FontWeight, FontStretch);
|
||||||
var pixelsPerDpi = VisualTreeHelper.GetDpi(this).PixelsPerDip;
|
var pixelsPerDip = VisualTreeHelper.GetDpi(this).PixelsPerDip;
|
||||||
var pen = CreatePen();
|
var pen = CreatePen();
|
||||||
|
|
||||||
for (var lat = latLabelStart; lat <= boundingBox.North; lat += lineDistance)
|
for (var lat = latLabelStart; lat <= boundingBox.North; lat += lineDistance)
|
||||||
{
|
{
|
||||||
latLabels.Add(new Label(lat, new FormattedText(
|
latLabels.Add(new Label(lat, new FormattedText(
|
||||||
GetLabelText(lat, labelFormat, "NS"),
|
GetLabelText(lat, labelFormat, "NS"),
|
||||||
CultureInfo.InvariantCulture, FlowDirection.LeftToRight, typeface, FontSize, Foreground, pixelsPerDpi)));
|
CultureInfo.InvariantCulture, FlowDirection.LeftToRight, typeface, FontSize, Foreground, pixelsPerDip)));
|
||||||
|
|
||||||
drawingContext.DrawLine(pen,
|
drawingContext.DrawLine(pen,
|
||||||
projection.LocationToViewportPoint(new Location(lat, boundingBox.West)),
|
projection.LocationToViewportPoint(new Location(lat, boundingBox.West)),
|
||||||
|
|
@ -81,7 +80,7 @@ namespace MapControl
|
||||||
{
|
{
|
||||||
lonLabels.Add(new Label(lon, new FormattedText(
|
lonLabels.Add(new Label(lon, new FormattedText(
|
||||||
GetLabelText(Location.NormalizeLongitude(lon), labelFormat, "EW"),
|
GetLabelText(Location.NormalizeLongitude(lon), labelFormat, "EW"),
|
||||||
CultureInfo.InvariantCulture, FlowDirection.LeftToRight, typeface, FontSize, Foreground, pixelsPerDpi)));
|
CultureInfo.InvariantCulture, FlowDirection.LeftToRight, typeface, FontSize, Foreground, pixelsPerDip)));
|
||||||
|
|
||||||
drawingContext.DrawLine(pen,
|
drawingContext.DrawLine(pen,
|
||||||
projection.LocationToViewportPoint(new Location(boundingBox.South, lon)),
|
projection.LocationToViewportPoint(new Location(boundingBox.South, lon)),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue