mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Update MapPath.cs
This commit is contained in:
parent
d041fecce9
commit
3e74e1e1f9
|
|
@ -70,24 +70,14 @@ namespace MapControl
|
||||||
|
|
||||||
protected virtual void UpdateData()
|
protected virtual void UpdateData()
|
||||||
{
|
{
|
||||||
|
MapPanel.SetLocation(this, Location);
|
||||||
|
|
||||||
if (parentMap != null && Data != null && Location != null)
|
if (parentMap != null && Data != null && Location != null)
|
||||||
{
|
{
|
||||||
var location = Location;
|
var scale = parentMap.GetScale(Location);
|
||||||
var viewPos = parentMap.LocationToView(location);
|
|
||||||
|
|
||||||
if (parentMap.MapProjection.IsNormalCylindrical &&
|
|
||||||
(viewPos.X < 0d || viewPos.X > parentMap.RenderSize.Width ||
|
|
||||||
viewPos.Y < 0d || viewPos.Y > parentMap.RenderSize.Height))
|
|
||||||
{
|
|
||||||
location = new Location(location.Latitude, parentMap.ConstrainedLongitude(location.Longitude));
|
|
||||||
viewPos = parentMap.LocationToView(location);
|
|
||||||
}
|
|
||||||
|
|
||||||
var scale = parentMap.GetScale(location);
|
|
||||||
var transform = new Matrix(scale.X, 0d, 0d, scale.Y, 0d, 0d);
|
var transform = new Matrix(scale.X, 0d, 0d, scale.Y, 0d, 0d);
|
||||||
|
|
||||||
transform.Rotate(parentMap.ViewTransform.Rotation);
|
transform.Rotate(parentMap.ViewTransform.Rotation);
|
||||||
transform.Translate(viewPos.X, viewPos.Y);
|
|
||||||
|
|
||||||
Data.Transform = new MatrixTransform { Matrix = transform };
|
Data.Transform = new MatrixTransform { Matrix = transform };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue