mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-08 16:05:50 +00:00
Removed MoveMap feature
This commit is contained in:
parent
4c669f4df0
commit
4b2771d27d
6 changed files with 86 additions and 116 deletions
|
|
@ -277,39 +277,11 @@ namespace MapControl
|
|||
viewCenter = new Point(ActualWidth / 2d, ActualHeight / 2d);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Moves the map by the difference of the specified position in view coordinates and a temporary
|
||||
/// transform origin point that has been set before by a call to SetTransformCenter. Map movement
|
||||
/// must be terminated by a call to EndMoveMap. MoveMap provides higher accuracy than TranslateMap.
|
||||
/// </summary>
|
||||
public void MoveMap(Point position)
|
||||
{
|
||||
if (transformCenter != null)
|
||||
{
|
||||
viewCenter = position;
|
||||
UpdateTransform();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Terminates map movement by the MoveMap method.
|
||||
/// </summary>
|
||||
public void EndMoveMap()
|
||||
{
|
||||
if (transformCenter != null)
|
||||
{
|
||||
ResetTransformCenter();
|
||||
UpdateTransform();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Changes the Center property according to the specified translation in view coordinates.
|
||||
/// </summary>
|
||||
public void TranslateMap(Point translation)
|
||||
{
|
||||
EndMoveMap();
|
||||
|
||||
if (translation.X != 0d || translation.Y != 0d)
|
||||
{
|
||||
var center = ViewToLocation(new Point(viewCenter.X - translation.X, viewCenter.Y - translation.Y));
|
||||
|
|
@ -328,7 +300,11 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public void TransformMap(Point center, Point translation, double rotation, double scale)
|
||||
{
|
||||
if (rotation != 0d || scale != 1d)
|
||||
if (rotation == 0d && scale == 1d)
|
||||
{
|
||||
TranslateMap(translation);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetTransformCenter(center);
|
||||
|
||||
|
|
@ -352,12 +328,6 @@ namespace MapControl
|
|||
|
||||
UpdateTransform(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// More accurate than SetTransformCenter.
|
||||
//
|
||||
TranslateMap(translation);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue