LuciadCPillar C# 2023.1.03
Luciad.Maps.MapNavigator.PanAction Class Reference

Class that allows to build a pan action and apply it, either directly or using an animation. More...

Inheritance diagram for Luciad.Maps.MapNavigator.PanAction:

Public Member Functions

Luciad.Maps.MapNavigator.PanAction Animate (bool animated)
 Specifies if the action should use an animation. More...
 
void Dispose ()
 
Luciad.Maps.MapNavigator.PanAction Duration (System.TimeSpan duration)
 Specifies the duration of the animation. More...
 
Luciad.Maps.MapNavigator.PanAction From (Luciad.Geometries.Point fromMapLocation)
 Sets the Map location (i.e. More...
 
Luciad.Maps.MapNavigator.PanAction FromViewLocation (Luciad.Cartesian.Coordinate fromViewLocation)
 Sets the location in view (device independent pixel) coordinates from which the pan action will start. More...
 
void Pan ()
 Executes the pan action by moving the 'from' Map location (PanAction::from or PanAction::fromViewLocation) to the location in view (device independent pixels) coordinates (PanAction::toLocation). More...
 
Luciad.Maps.MapNavigator.PanAction ToLocation (Luciad.Cartesian.Coordinate toViewLocation)
 Executes the pan action by moving the 'from' Map location (PanAction::from or PanAction::fromViewLocation) to the given location in view (device independent pixel) coordinates. More...
 

Detailed Description

Class that allows to build a pan action and apply it, either directly or using an animation.

Panning works by 'grabbing' a point on the map: see from defining where that point ends up after the pan operation: see toLocation

Example of an immediate pan action:

Example of an incremental pan action (for example based on a mouse drag):

Map.ViewMapTransformation viewMapTransformation = map.GetViewMapTransformation();
Point point = viewMapTransformation.ViewToMap(Map.LocationMode.ClosestSurface, fromViewLocation);
if (point != null)
{
panAction = map.MapNavigator.NewPanAction().From(point);
// When a drag event arrives
panAction.ToLocation(eventLocation).Pan();
// When another drag event arrives
panAction.ToLocation(eventLocation).Pan();
// When the drag gesture stops: cleanup
panAction.Dispose();
}
This class allows to transform between view (pixel coordinates on the screen) and map coordinates.
Definition: Map.cs:885
Luciad.Geometries.Point ViewToMap(Luciad.Maps.Map.LocationMode locationMode, Luciad.Cartesian.Coordinate coordinate)
Transform a coordinate from the view to a point in the world reference using the desired location mod...
Definition: Map.cs:922
A map for showing geo-spatial data.
Definition: Map.cs:13
LocationMode
Used to determine how the Map::getViewToMapTransformation method determines the point in Map coordina...
Definition: Map.cs:1130
Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::MapNavigator::PanAction.

Member Function Documentation

◆ Animate()

Luciad.Maps.MapNavigator.PanAction Luciad.Maps.MapNavigator.PanAction.Animate ( bool  animated)
inline

Specifies if the action should use an animation.

animated

if this action should use an animation. The default is false.

this

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::MapNavigator::PanAction::animate.

◆ Dispose()

void Luciad.Maps.MapNavigator.PanAction.Dispose ( )
inline

◆ Duration()

Luciad.Maps.MapNavigator.PanAction Luciad.Maps.MapNavigator.PanAction.Duration ( System.TimeSpan  duration)
inline

Specifies the duration of the animation.

This parameter is only used if animate(bool) is called with true as argument.

duration

the duration of the animation in milliseconds. The default is 2000 (=2 seconds)

this

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::MapNavigator::PanAction::duration.

◆ From()

Luciad.Maps.MapNavigator.PanAction Luciad.Maps.MapNavigator.PanAction.From ( Luciad.Geometries.Point  fromMapLocation)
inline

Sets the Map location (i.e.

a coordinate defined in Map::getReference) from which the pan action will start. This point will be moved to a new view location when the pan action is executed. Setting the from location is mandatory. Make sure to call either this method or the fromViewLocation method. Not setting the from location will cause the PanAction::pan method to throw an exception. When it is set more than once, only the last call to one of the 'from' methods will be taken into account.

fromMapLocation

a point defined in the reference of the Map

this

luciad::InvalidArgumentException

if the from location is not set in the map coordinate reference.

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::MapNavigator::PanAction::from.

◆ FromViewLocation()

Luciad.Maps.MapNavigator.PanAction Luciad.Maps.MapNavigator.PanAction.FromViewLocation ( Luciad.Cartesian.Coordinate  fromViewLocation)
inline

Sets the location in view (device independent pixel) coordinates from which the pan action will start.

This point on the map that corresponds to this view location will be moved to a new view location when the pan action is executed. Additionally, when using this method the panning behavior will be slightly different compared to when using the from method: when using a point near the horizon, the movement of the camera will be limited to prevent very large changes to it. If no point on the map corresponds to this view location, the pan action will have no effect. Setting the from location is mandatory. Make sure to call either this method or the from method. Not setting the from location will cause the PanAction::pan method to throw an exception. When it is set more than once, only the last call to one of the 'from' methods will be taken into account.

fromViewLocation

the location in view (device independent pixel) coordinates from which the pan action will start.

this

2023.0

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::MapNavigator::PanAction::fromViewLocation.

◆ Pan()

void Luciad.Maps.MapNavigator.PanAction.Pan ( )
inline

Executes the pan action by moving the 'from' Map location (PanAction::from or PanAction::fromViewLocation) to the location in view (device independent pixels) coordinates (PanAction::toLocation).

If PanAction::animate is called with true as argument, this method will start a pan animation. It is possible to call this method multiple times with different parameters. This allows to start a pan session. A pan session is useful, for example, when navigating using the mouse, for example using a drag gesture. Starting a drag will create the action with an initial state (PanAction::from or PanAction::fromViewLocation) Intermediate drag events will execute an intermediate action (by calling PanAction::to and PanAction::pan) Ending a drag will destroy the PanAction, which will perform cleanup

See MapNavigator::PanAction for an example usage.

luciad::LogicException

if the action is not built correctly, for example if mandatory parameters are missing, or if incompatible parameters are configured.

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::MapNavigator::PanAction::pan.

◆ ToLocation()

Luciad.Maps.MapNavigator.PanAction Luciad.Maps.MapNavigator.PanAction.ToLocation ( Luciad.Cartesian.Coordinate  toViewLocation)
inline

Executes the pan action by moving the 'from' Map location (PanAction::from or PanAction::fromViewLocation) to the given location in view (device independent pixel) coordinates.

If PanAction::animate is called with true as argument, this method will start a pan animation.

toViewLocation

a location in view (device independent pixel) coordinates

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::MapNavigator::PanAction::toLocation.