new AbstractNavigation(type, ctx [, options])
Parameters:
| Name | Type | Argument | Default | Description |
|---|---|---|---|---|
type |
NAVIGATION | type of navigation | ||
ctx |
AbstractContext | context | ||
options |
AbstractNavigation.configuration |
<optional> |
{} | options for navigation |
- Implements:
- See:
-
- NavigationHandlerFactory the possible handlers
- MouseNavigationHandler for its options when it is set by default
- KeyboardNavigationHandler for its options when it is set by default
- TouchNavigationHandler for its options when isMobile is set to True
Extends
Methods
-
getType()
-
Returns the type of navigation. The type can take one of the following value : AstroNavigation, FlatNavigation, PlanetNavigation
- Implements:
Returns:
the name of the navigation class, which is used- Type
- string
-
getOptions()
-
Returns the navigation's options given at the initialisation.
- Implements:
Returns:
Options- Type
- Object
-
start()
-
Starts the navigation.
- Implements:
-
stop()
-
Stops the navigation.
- Implements:
-
stopAnimations()
-
Stops the animations.
- Implements:
-
getFov()
-
Returns the field of view in decimal degree.
- Implements:
Returns:
the Field of view [fov along width, fov along height]- Type
- Array.<float>
-
getCenter()
-
Returns the center of the field of view.
- Implements:
Returns:
the center in decimal degree of the field of view [longitude, latitude]- Type
- Array.<float>
-
<abstract> rotate(dx, dy)
-
Rotates the camera.
Parameters:
Name Type Description dxfloat Window delta x dyfloat Window delta y - Implements:
-
<abstract> pan(dx, dy)
-
Pans the camera to a direction up/down or left/right with the same distance from the object
Parameters:
Name Type Description dxfloat Window direction left/right dyfloat Window direction up/down - Implements:
-
<abstract> zoom(delta, scale)
-
Applies zooming.
Parameters:
Name Type Description deltafloat Delta zoom scalefloat Scale - Implements:
-
<abstract> zoomTo(geoPos, options)
-
Zooms to a 2D position (longitude, latitude).
Parameters:
Name Type Description geoPosArray.<float> spatial position in decimal degree [longitude, latitude] optionsObject options for zoomTo - Implements:
-
<abstract> computeViewMatrix()
-
Computes the view matrix
- Implements:
-
toViewMatrix(mat, fov, duration, callback)
-
Basic animation from current view matrix to the given one
Parameters:
Name Type Description matArray.<Object> Destination view matrix (array of 16) fovint Final zooming fov in degrees durationint Duration of animation in milliseconds callbacknavigationCallback Callback at the end of animation - Implements:
-
getRenderContext()
-
Returns the rendering context.
- Implements:
Returns:
the rendering context- Type
- RenderContext
-
setRenderContext(renderContext)
-
Sets the rendering context
Parameters:
Name Type Description renderContextRenderContext the rendering context to set - Implements:
Type Definitions
-
configuration
-
Navigation configuration
Type:
- Object
Properties:
Name Type Argument Default Description inertiaboolean <optional>
false Animation simulating inertia for camera's navigation inertiaAnimationAbstractAnimation.inertia_configuration Inertia Animation is used when inertia is true handlersArray.<Object> = [MouseNavigationHandler,KeyboardNavigationHandler[,TouchNavigationHandler]] mouseAbstractNavigation.mouse_configuration <optional>
Mouse navigation configuration when handlers is not defined keyboardAbstractNavigation.keyboard_configuration <optional>
Keyboard navigation configuration when handlers is not defined isMobileboolean <optional>
false TouchNavigationHandler configuration when handlers is not defined, sets to true this parameter to support mobile device -
astro_configuration
-
Astro navigation configuration
Type:
Properties:
Name Type Argument Default Description initTargetArray.<float> <optional>
[0,0] initial target of the camera in decimal degree (longitude, latitude) initFovfloat <optional>
0.001 initial field of view of the camera in decimal degree minFovfloat <optional>
0.001 Minimal field of view of the camera in decimal degree maxFovfloat <optional>
100 Maximal field of view of the camera in decimal degree upArray.<float> <optional>
[0.0, 0.0, 1.0] Up vector that defines the north -
flat_configuration
-
Flat navigation configuration
Type:
Properties:
Name Type Argument Default Description initTargetArray.<float> <optional>
[0, 0, 5.0 * RADIUS_PLANET] Target in decimal degree (longitude, latitude, distance in meter) at initialisation. distance in meter is optional. minDistancefloat <optional>
60000 The minimum distance in meters from the surface of the globe or options.initTarget[2] when this one is inferior to options.minDistance maxDistancefloat <optional>
5.0 * RADIUS_PLANET The maximum distance in meters or options.initTarget[2] when this one is superior to options.maxDistance -
googleMouse_configuration
-
Google mouse navigation handler configuration
Type:
- Object
-
keyboard_configuration
-
Keyboard navigation handler configuration
Type:
- Object
Properties:
Name Type Argument Default Description panFactorfloat <optional>
10.0 Factor for panning within the scene zoomFactorfloat <optional>
1.0 Factor for zooming into the scene installOnDocumentboolean <optional>
false True to install the event listener on the document and not on the canvas -
mouse_configuration
-
Mouse navigation handler configuration
Type:
- Object
Properties:
Name Type Argument Default Description panButtonfloat <optional>
0 rotateButtonfloat <optional>
1 zoomOnDblClickboolean <optional>
false if true defines animation on double click zoomOptionsObject <optional>
@see look at options in Navigation#zoomTo -
planet_configuration
-
Flat navigation configuration
Type:
Properties:
Name Type Argument Default Description initTargetArray.<float> <optional>
[0, 0, 3.0 * RADIUS_PLANET] Target in decimal degree (longitude, latitude, distance in meter) at initialisation. distance in meter is optional. minDistanceint <optional>
0 the minimum distance sets to 60 Km by default or options.initTarget[2] when this one is inferior to options.minDistance maxDistanceint <optional>
3*RADIUS_PLANET the maximum distance sets to 3*RADIUS_PLANET by default or options.initTarget[2] when this one is superior to options.maxDistance updateViewMatrixboolean <optional>
false indicating if view matrix must be updated on initialization. -
touch_configuration
-
Touch navigation handler configuration
Type:
- Object
Properties:
Name Type Argument Default Description inversedboolean <optional>
false if true inverse the sens of touching events zoomOnDblClickboolean <optional>
false if true defines animation on double click
Documentation