NavigationConfig
- class cee.NavigationConfig()
Navigation configuration for a view.
Specify how mouse and touch input should be used to navigate the view (move the camera).
Note: To use the right mouse button (either rightMouseButton or leftAndRightMouseButtons), you need to disable the default context menu in the browser (see example below).
Example on how to configure “Ceetron style” navigation:
// Disable context menu - Required for enableMouseButtonTracking canvas.addEventListener("contextmenu", (event) => { event.preventDefault()}); // Enable mouse tracking (so we can use leftAndRightMouseButtons) viewer.enableMouseButtonTracking(true); // Ceetron style navigation const navConfig = view.navigation.config; navConfig.leftMouseButton.noModifier =cee.NavigationType.PAN; navConfig.rightMouseButton.noModifier =cee.NavigationType.ROTATE; navConfig.leftAndRightMouseButtons.noModifier =cee.NavigationType.WALK; navConfig.wheelOrPinch = cee.NavigationType.WALK;
Properties
Properties
- NavigationConfig.invertWalkZoom
- Type:
boolean
Invert zoom or walk. If true, camera will zoom out if mouse is moved up
Default is false
- NavigationConfig.invertWheel
- Type:
boolean
Invert the zoom direction of the mouse wheel
Default is false
- NavigationConfig.leftAndRightMouseButtons
- Type:
NavigationMouseButtonConfig
Navigation config when both left and right mouse buttons are pressed.
Default is NONE for all modifier states.
Note: To use the leftAndRightMouseButtons you have to enable mouse tracking in the viewer. See
Viewer.enableMouseButtonTracking
. This again requires the browser context menu to be disabled
- NavigationConfig.leftMouseButton
- Type:
NavigationMouseButtonConfig
Navigation config for left mouse button.
Default is
no modifiers -> ROTATE
shift pressed -> WALK
ctrl or cmd pressed -> PAN
- NavigationConfig.middleMouseButton
- Type:
NavigationMouseButtonConfig
Navigation config for middle mouse button.
Default is NONE for all modifier states.
- NavigationConfig.oneFinger
- Type:
NavigationType
Navigation type to use for one finger dragging.
Default is ROTATE
- NavigationConfig.rightMouseButton
- Type:
NavigationMouseButtonConfig
Navigation config for right mouse button.
Default is NONE for all modifier states.
- NavigationConfig.twoFinger
- Type:
NavigationType
Navigation type to use for two finger dragging.
Default is PAN
- NavigationConfig.wheelOrPinch
- Type:
NavigationType
Navigation type to use for mouse wheel/touch screen pinch events.
Default is WALK