Default widgets
As part of the library bundle you will gain access to a number of out of the box widgets made by Nextspace.
Enabling / Disabling
The widgets are enabled by default and created when you run ViewerUtils.InitViewer
You can opt out of them using the nextspaceWidgets: false param.
If you want specific widgets then you can create them in two parts.
If you want to disable a widget after it has been created then you can do so by accessing the widget directly.
Once disposed a widget will need to be recreated, so recall the creation function to return it.
Cursor bar
The cursor bar widget is a toolbar found in the top-left of your screen. It provides a default set of 3 tools with a future intention of allowing custom tools to be added.
The tools available so far are:
- Select: allows you to click Entities within the scene to select them.
- Pan: stops the cursor from selecting Entities and allows you to pan the camera around the scene.
- Measure: allows you to measure a point, polyline, or polygon.
Navigation compass
The navigation compass will let you rotate around the center of the camera view, turn the camera up and down, zoom in and out, and switch between 2D and 3D camera lenses.
Search bar
The search bar runs on the Cesium address API which means you will need the Cesium's access token set in order to use it.
Bookmarks selection
The Bookmarks selection widget allows you to swap between Bookmarks for a particular Project View.
When you call ViewRenderEngine.Render it will automatically update the widget with the related View and Bookmark.
Alternatively you can interact with the widget programmatically and avoid the view render engine call.
The JSFiddle below shows how to interact with the Bookmarks widget programmatically.
Info view
Info view is a panel that shows selected Entity details. Right now it'll show attributes and the default photo.
This panel will appear when there is at least one selected Entity, if multiple Entities are selected then the first one's data is visible.
If this widget is enabled alongside the cursor-bar then the user can click on the scene and view the Entity details.
The JSFiddle below shows how to disable the default Info View widget and start building your own.