Class Viewer3DM defines the main interface to the 3DMapping viewer SDK. See the documentation at https://orbitgt.com/kb/3dmapping_sdk

Constructor

new (applicationName:String, options:AMap<Dynamic>)

Create a new instance of the viewer.

Parameters:

applicationName

the name of the application that is using the SDK.

options

the map of startup options.

Variables

isReady:Promise<Viewer3DM>

Promise that resolves when the viewer is ready for use.

onAppStateChanged:Signal<String>

Signal that is dispatched after the application state has changed. The new state is passed as an argument.

onFocusPositionChanged:Signal<Coordinate>

Signal that is dispatched after the focus position has been changed. The new position is passed as an argument (can be null).

onHoverPositionChanged:Signal<Coordinate>

Signal that is dispatched after the hover position has been changed. The new position is passed as an argument (can be null).

onMeasureCompleted:Signal<MeasureState>

Signal that is dispatched after a measurement has been completed. The completed measurement is passed as an argument.

onMeasureUpdated:Signal<MeasureState>

Signal that is dispatched after a measurement has been updated. The (incomplete) measurement is passed as an argument.

onPickPositionRequested:Signal<Dynamic>

Signal that is dispatched when the viewer needs a location to be picked on the reference map by the user. When a location has been picked by the user, use the setPickedPosition() method to pass it to the viewer.

onResourceAdded:Signal<String>

Signal that is dispatched after a resource has been added to the workspace. The identifier of the resource is passed as an argument.

onResourceRemoved:Signal<String>

Signal that is dispatched after a resource has been removed from the workspace. The identifier of the resource is passed as an argument.

onViewClosed:Signal<String>

Signal that is dispatched after a view has been closed. The identifier of the view is passed as an argument.

onViewOpened:Signal<String>

Signal that is dispatched after a view has been opened. The identifier of the view is passed as an argument.

onViewStateChanged:Signal<String>

Signal that is dispatched after a view state has changed. The identifier of the view is passed as an argument.

onWorkspaceClosed:Signal<Dynamic>

Signal that is dispatched after a workspace has been closed.

onWorkspaceOpened:Signal<Dynamic>

Signal that is dispatched after a workspace has been opened.

onZoomToExtent:Signal<Bounds>

Signal that is dispatched after the user requested an overview to the extent of a resource. The extent of that resource is passed as an argument.

Methods

closeView (viewId:String):Void

Close a view.

Parameters:

viewId

the identifier of a view.

doAction (action:String, arguments:AList<Dynamic>):Dynamic

Perform an action.

Parameters:

action

The action to perform.

arguments

The arguments.

Returns:

Returns the result.

doPlayStart (viewId:String, forward:Bool, fast:Bool):Void

Start the play function of a view.

Parameters:

viewId

the identifier of a view.

forward

play in the forward direction?

fast

play with a fast or normal speed?

doPlayStop (viewId:String):Void

Stop the play function of a view.

Parameters:

viewId

the identifier of a view.

duplicateView (viewId:String):Promise<String>

Duplicate a view.

Parameters:

viewId

the identifier of a view to duplicate.

Returns:

the promise for the identifier of the new view. this promise resolves when the new view is ready for use.

getFieldOfViews (viewIds:AList<String>):AList<MapObject>

Get the field-of-view of a view.

Parameters:

viewIds

The view identifiers to return field-of-view objects for (null for all).

Returns:

Returns the field-of-view objects.

getFocusPosition ():Coordinate

Get the focus position of the viewer.

Returns:

Returns the current focus position (can be null).

getHoverPosition ():Coordinate

Get the hover position of the viewer.

Returns:

Returns the current hover position (can be null).

getMeasureState ():MeasureState

Get the state of the measurement.

Returns:

Returns the current measure state or null in case the measure function is not active.

getProperty (propertyName:String):Dynamic

Get a property.

Parameters:

propertyName

The name of the property.

Returns:

Returns the property value.

getResource (resourceId:String):Resource

Get a resource description.

Parameters:

resourceId

the resource identifier.

Returns:

Returns the resource description.

getResources ():AList<Resource>

Get all resource descriptions.

Returns:

Returns a list of resource descriptions.

getStaticFootprints (resourceIds:AList<String>, is3D:Bool):Promise<AList<MapObject>>

Get the static (full) footprint of a resource.

Parameters:

resourceIds

the resource identifiers.

is3D

return geometries as 3D?

Returns:

Returns the footprint objects.

getStreamingFootprints2D (resourceIds:AList<String>, viewbounds:Bounds):Promise<AList<MapObject>>

Get the streaming footprint of a resource for a 2D map.

Parameters:

resourceIds

the resource identifiers.

viewbounds

the bounds of the 2D view.

Returns:

Returns the footprint objects.

getViewState (viewId:String):ViewState

Get the state of a view.

Parameters:

viewId

the identifier of a view.

Returns:

Returns the state of the view of null in case it does not exist.

getViewStates (viewIds:AList<String>):AList<ViewState>

Get the state for all views.

Parameters:

viewIds

the optional list of view identifiers to return state for (null to return all).

Returns:

Returns the state of the views.

moveViewPosition (viewId:String, forward:Float, sideward:Float, upward:Float):Void

Move the position of a view.

Parameters:

forward

the distance in the view direction (positive moves forward).

sideward

the distance in the left direction (positive moves left).

upward

the distance in the up direction (positive moves up).

setFocusPosition (position:Coordinate, options:AMap<Dynamic>):Void

Set the focus position of the viewer. The viewer responds depending on the current state of its views. A photo view opens a photo near the position for example.

Parameters:

position

The position to focus to.

options

A map of photo loading options (can be null).

setPickPosition (position:Coordinate):Void

Communicate a position that was picked by the user to the viewer. Calling this function only has effect when it is called after the onPickPositionRequested signal/event has been dispatched. For example, this signal is dispatched when the user wants to move a view.

Parameters:

position

The user-chosen position.

setProperty (propertyName:String, propertyValue:Dynamic):Void

Set a property.

Parameters:

propertyName

The name of the property.

propertyValue

The value of the property.

setSize (width:Float, height:Float):Void

Set the viewer component size.

Parameters:

width

The new viewer width.

height

The new viewer height.

setViewOrientation (viewId:String, pan:Float, tilt:Float, fov:Float):Void

Set the orientation of a view.

Parameters:

viewId

the identifier of a view.

pan

the new pan angle (degrees, 0 means north, 90 means east).

tilt

the new tilt angles (degrees, positive means looking up).

fov

an optional new horizontal field-of-view angle (degrees, ignored if zero, only for photo views).

setViewPosition (viewId:String, position:Coordinate):Void

Set the position of a view.

Parameters:

viewId

the identifier of a view.

position

the new position of the view.

setViewRenderMode (viewId:String, renderMode:String):Void

Set the render mode of a view.

Parameters:

viewId

the identifier of a view.

renderMode

the new render mode of the view (see the ViewState class for a list of possible values).

setWorkspaceLayout (layoutName:String):Void

Set the layout of the workspace.

Parameters:

layoutName

the name of the new layout.

showLoginPanel ():Void

Popup the view login panel.

transformCoordinate (coordinate:Coordinate, targetCRS:String):Coordinate

Transform a coordinate to a different CRS.

Parameters:

coordinate

The coordinate to transform.

targetCRS

The target EPSG code.

Returns:

Coordinate The coordinate expressed in the new CRS.