Updated MapGraticule

This commit is contained in:
ClemensFischer 2025-06-09 22:34:05 +02:00
parent 0696441a4e
commit 5a681d3580
4 changed files with 16 additions and 57 deletions

View file

@ -40,11 +40,17 @@ namespace MapControl
private const double LineInterpolationResolution = 2d;
public static readonly DependencyProperty StrokeThicknessProperty =
DependencyPropertyHelper.Register<MapGraticule, double>(nameof(StrokeThickness), 0.5);
public static readonly DependencyProperty MinLineDistanceProperty =
DependencyPropertyHelper.Register<MapGraticule, double>(nameof(MinLineDistance), 150d);
private double lineDistance;
private string labelFormat;
public double StrokeThickness
{
get => (double)GetValue(StrokeThicknessProperty);
set => SetValue(StrokeThicknessProperty, value);
}
/// <summary>
/// Minimum graticule line distance in pixels. The default value is 150.
@ -55,6 +61,9 @@ namespace MapControl
set => SetValue(MinLineDistanceProperty, value);
}
private double lineDistance;
private string labelFormat;
private void SetLineDistance()
{
var minDistance = MinLineDistance / PixelPerLongitudeDegree(ParentMap.Center);