mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-08 16:05:50 +00:00
Use Matrix for projection relative scale
This commit is contained in:
parent
2c9e478095
commit
ab155a26e7
21 changed files with 93 additions and 104 deletions
|
|
@ -88,13 +88,13 @@ namespace MapControl
|
|||
|
||||
protected override Size MeasureOverride(Size availableSize)
|
||||
{
|
||||
double scale;
|
||||
|
||||
if (ParentMap == null || (scale = ParentMap.GetMapScale(ParentMap.Center).X) <= 0d)
|
||||
if (ParentMap == null)
|
||||
{
|
||||
return new Size();
|
||||
}
|
||||
|
||||
var p = ParentMap.GetMapToViewTransform(ParentMap.Center).Transform(new Point(1d, 0d));
|
||||
var scale = Math.Sqrt(p.X * p.X + p.Y * p.Y);
|
||||
var length = MinWidth / scale;
|
||||
var magnitude = Math.Pow(10d, Math.Floor(Math.Log10(length)));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue