LuciadCPillar C# 2023.1.04
Luciad.Maps.MapNavigator.ZoomAction Class Reference

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

Inheritance diagram for Luciad.Maps.MapNavigator.ZoomAction:

Public Member Functions

Luciad.Maps.MapNavigator.ZoomAction Animate (bool animated)
 Specifies if the action should use an animation. More...
 
void Dispose ()
 
Luciad.Maps.MapNavigator.ZoomAction Duration (System.TimeSpan duration)
 Specifies the duration of the animation. More...
 
Luciad.Maps.MapNavigator.ZoomAction Factor (double factor)
 Sets the zoom factor. More...
 
Luciad.Maps.MapNavigator.ZoomAction TargetScale (Luciad.Maps.MapScale targetScale)
 Sets the map scale to which to zoom to. More...
 
Luciad.Maps.MapNavigator.ZoomAction ToLocation (Luciad.Geometries.Point toMapLocation)
 Sets the location (in Map coordinates) towards which the MapNavigator will zoom. More...
 
void Zoom ()
 Executes the zoom action. More...
 

Detailed Description

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

Zooming works by: defining a location towards which to zoom (ZoomAction::toLocation) defining how much to zoom (ZoomAction::factor)

Example: zoom in 50% (2x zoom)

Map.ViewMapTransformation viewMapTransformation = map.GetViewMapTransformation();
Point point = viewMapTransformation.ViewToMap(Map.LocationMode.ClosestSurface, toViewLocation);
if (point != null)
{
map.MapNavigator.NewZoomAction().ToLocation(point).Factor(0.5).Zoom();
}
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::ZoomAction.

Member Function Documentation

◆ Animate()

Luciad.Maps.MapNavigator.ZoomAction Luciad.Maps.MapNavigator.ZoomAction.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::ZoomAction::animate.

◆ Dispose()

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

◆ Duration()

Luciad.Maps.MapNavigator.ZoomAction Luciad.Maps.MapNavigator.ZoomAction.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::ZoomAction::duration.

◆ Factor()

Luciad.Maps.MapNavigator.ZoomAction Luciad.Maps.MapNavigator.ZoomAction.Factor ( double  factor)
inline

Sets the zoom factor.

A value larger than 1 will zoom out. A value between ]0, 1[ will zoom in. For example: A zoom factor of 0.5 will move the camera twice as close to the target location. A value of 2.0 will move the camera away twice as far from the target location. It is mandatory to set either this property, or the targetScale property. Not setting either of them will cause the ZoomAction::zoom method to throw an exception. If both methods are called, the one called last has precedence.

factor

the zoom factor, a value between ]0, 1[ to zoom in and between ]1, +inf[ to zoom out.

this

luciad::InvalidArgumentException

if the factor value is invalid.

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

◆ TargetScale()

Luciad.Maps.MapNavigator.ZoomAction Luciad.Maps.MapNavigator.ZoomAction.TargetScale ( Luciad.Maps.MapScale  targetScale)
inline

Sets the map scale to which to zoom to.

It is mandatory to set either this property, or the factor property. Not setting either of them will cause the ZoomAction::zoom method to throw an exception. If both methods are called, the one called last has precedence.

targetScale

the target scale to zoom to

this

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

◆ ToLocation()

Luciad.Maps.MapNavigator.ZoomAction Luciad.Maps.MapNavigator.ZoomAction.ToLocation ( Luciad.Geometries.Point  toMapLocation)
inline

Sets the location (in Map coordinates) towards which the MapNavigator will zoom.

This property is mandatory. Not setting it will cause the ZoomAction::zoom method to throw an exception.

toMapLocation

a location, defined in the reference of the Map

this

luciad::InvalidArgumentException

if the toMapLocation parameter is not in the map coordinate reference.

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

◆ Zoom()

void Luciad.Maps.MapNavigator.ZoomAction.Zoom ( )
inline

Executes the zoom action.

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::ZoomAction::zoom.