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 dx
float Window delta x dy
float 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 dx
float Window direction left/right dy
float Window direction up/down - Implements:
-
<abstract> zoom(delta, scale)
-
Applies zooming.
Parameters:
Name Type Description delta
float Delta zoom scale
float Scale - Implements:
-
<abstract> zoomTo(geoPos, options)
-
Zooms to a 2D position (longitude, latitude).
Parameters:
Name Type Description geoPos
Array.<float> spatial position in decimal degree [longitude, latitude] options
Object 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 mat
Array.<Object> Destination view matrix (array of 16) fov
int Final zooming fov in degrees duration
int Duration of animation in milliseconds callback
navigationCallback 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 renderContext
RenderContext the rendering context to set - Implements:
Type Definitions
-
configuration
-
Navigation configuration
Type:
- Object
Properties:
Name Type Argument Default Description inertia
boolean <optional>
false Animation simulating inertia for camera's navigation inertiaAnimation
AbstractAnimation.inertia_configuration Inertia Animation is used when inertia is true handlers
Array.<Object> = [MouseNavigationHandler,KeyboardNavigationHandler[,TouchNavigationHandler]] mouse
AbstractNavigation.mouse_configuration <optional>
Mouse navigation configuration when handlers is not defined keyboard
AbstractNavigation.keyboard_configuration <optional>
Keyboard navigation configuration when handlers is not defined isMobile
boolean <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 initTarget
Array.<float> <optional>
[0,0] initial target of the camera in decimal degree (longitude, latitude) initFov
float <optional>
0.001 initial field of view of the camera in decimal degree minFov
float <optional>
0.001 Minimal field of view of the camera in decimal degree maxFov
float <optional>
100 Maximal field of view of the camera in decimal degree up
Array.<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 initTarget
Array.<float> <optional>
[0, 0, 5.0 * RADIUS_PLANET] Target in decimal degree (longitude, latitude, distance in meter) at initialisation. distance in meter is optional. minDistance
float <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 maxDistance
float <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 panFactor
float <optional>
10.0 Factor for panning within the scene zoomFactor
float <optional>
1.0 Factor for zooming into the scene installOnDocument
boolean <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 panButton
float <optional>
0 rotateButton
float <optional>
1 zoomOnDblClick
boolean <optional>
false if true defines animation on double click zoomOptions
Object <optional>
@see look at options in Navigation#zoomTo -
planet_configuration
-
Flat navigation configuration
Type:
Properties:
Name Type Argument Default Description initTarget
Array.<float> <optional>
[0, 0, 3.0 * RADIUS_PLANET] Target in decimal degree (longitude, latitude, distance in meter) at initialisation. distance in meter is optional. minDistance
int <optional>
0 the minimum distance sets to 60 Km by default or options.initTarget[2] when this one is inferior to options.minDistance maxDistance
int <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 updateViewMatrix
boolean <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 inversed
boolean <optional>
false if true inverse the sens of touching events zoomOnDblClick
boolean <optional>
false if true defines animation on double click