Viewer Widget
Use the Viewer Widget API to include the Viewer Widget in your 3D viewer instance. The widget is useful for basic embedded viewer functionality. For more advanced usage make use of the Viewer APIs.
Follow the same installation steps when using jQuery with the following changes to include the Viewer Widget in your project.
- In step 4, provide the viewer-ui option to include the Viewer Widget.
- In step 6, after loading a model initialize the Viewer Widget by invoking the viewerUI method on the jQuery object for the div where the 3D viewer instance is attached.
Adjust the default behavior of the Viewer Widget by providing an options object when creating a Viewer Widget instance.
Name | Type | Default | Description |
---|---|---|---|
enableContextMenu | Boolean | false | Enable context menu features |
enableJoystick | Boolean | true | Enable joystick widget |
enableKeyboard | Boolean | false | Enable keyboard shortcuts and navigation |
enableViewer2dIntegration | Boolean | false | Enable Viewer2D integration |
joystickBorderOffset | String | '20px' | Joystick border offset |
joystickColor | String | 'blue' | Valid RGB value for color ofjoystick wdiget |
joystickHidden | Boolean | true | Hide joystick widget |
joystickPosition | String | 'bottom-center' | Position of joystick widget |
joystickRotationClamp | Number | 2 | Joystick rotation clamp |
joystickSize | Number | 100 | Size of joystick widget |
lockStoreyMode | Boolean | false | Lock storey mode |
showViewer2dLockedNavigationToggle | Boolean | false | Show Viewer2D locked navigation toggle |
showViewer2dStoreySelect | Boolean | false | Show Viewer2D storey select |
spacesVisible | Boolean | false | Show spaces |
viewer2dId | String | null | DOM element id of 2D Viewer instance |
translations | Object | {} | Translations for the Viewer Widget |
joystickPosition
Valid values are:
- 'middle-left'
- 'bottom-left'
- 'bottom-center'
- 'bottom-right'
- 'middle-right'
translations
Translations for the Viewer Widget.
Name | Default | Description |
---|---|---|
addClippingPlane | Add clipping plane | Add a clipping plane |
defaultBuildingName | (unknown building) | Default building name |
defaultModelName | (unknown model) | Default model name |
hide | Hide | Hide selected models |
hideOthers | Hide others | Hide all models except selected |
isolate | Isolate | Isolate selected models |
loading | Loading... | Loading models |
lookAt | Look at | Look at selected models |
makeTranslucent | Make translucent | Make selected models translucent |
noModelsLoaded | No models loaded. | No models loaded |
removeClippingPlanes | Remove clipping planes | Remove all clipping planes |
sectionTopAndBottom | Section top and bottom | Section top and bottom |
showAll | Show all | Show all models |
Hides the joystick.
Sets the joystick position.
position
Position of the joystick.
Type | Required |
---|---|
String | Yes |
Valid values are:
- 'middle-left'
- 'bottom-left'
- 'bottom-center'
- 'bottom-right'
- 'middle-right'
Set the 2D locked navigation mode. When enabled, the cursor will be in the center of the 2D scene.
isLocked
Positions the cursor in the center of the 2D scene.
Type | Required |
---|---|
Boolean | Yes |
Set the 2D lock storey mode. When disabled, the 2D viewer storey selection will follow the 3D viewer.
isLocked
Is the 2D lock storey mode enabled.
Type | Required |
---|---|
Boolean | Yes |
Set the space ids to be considered when spacesVisible option is false.
spaceIds
List of spaceIds
Type | Required |
---|---|
Array[String] | Yes |
Set spaces visibility.
areSpacesVisible
Are spaces visible.
Type | Required |
---|---|
Boolean | Yes |
Displays the joystick if enabled.
Sets the joystick options.
options
Options for the joystick.
Type | Required |
---|---|
Object | Yes |
Properties
Name | Type | Description |
---|---|---|
joystickBorderOffset | String | Margin from edge of viewport |
joystickColor | String | Color of the joystick |
joystickHidden | Boolean | Is the joystick hidden |
joystickPosition | String | Position of the joystick |
joystickRotationClamp | Number | Speed of scene navigation, valid value between 0 and 1 |
joystickSize | Number | Size of the joystick in pixels |
joystickPosition
Valid values are:
- 'middle-left'
- 'bottom-left'
- 'bottom-center'
- 'bottom-right'
- 'middle-right'