Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

  • Viewer3DM

Index

Constructors

constructor

  • new Viewer3DM(applicationName: string, options: AMap<Object>): Viewer3DM
  • Create a new instance of the viewer.

    Parameters

    • applicationName: string

      the name of the application that is using the SDK.

    • options: AMap<Object>

      the map of startup options. See the various STARTUP_ values in the Constants for available startup options.

    Returns Viewer3DM

Properties

isReady

isReady: Promise<Viewer3DM>

Promise that resolves when all javascript code has been loaded and the viewer is ready for use.
Wait for this promise to resolve before calling any other methods. Polling is possible by calling the isResolved() method (with boolean result) of the promise.

onAppStateChanged

onAppStateChanged: Signal<string>

Signal that is dispatched after the application state has changed.
The new state is passed as an argument. Save this state to disk and later pass it as the Constants.STARTUP_APP_STATE option in the startup options of the viewer to enable auto-login at the next start.

onFieldOfViewsChanged

onFieldOfViewsChanged: Signal<string>

Signal that is dispatched after the field-of-views have changed.
A optional message is passed as an argument. Call the getFieldOfViews2D() method to fetch new map objects to display on the host reference map.

onFocusPositionChanged

onFocusPositionChanged: Signal<Coordinate>

Signal that is dispatched after the focus position has been changed.
The new spatial position is passed as an argument (can be null if the focus has been cleared). Center (move) the host reference map to this position if it falls outside the current visible extent of the host reference map.

onFootprintsChanged

onFootprintsChanged: Signal<string>

Signal that is dispatched after the footprints have changed.
A optional message is passed as an argument. Call the getFootprints2D() method to fetch new map objects to display on the host reference map.

onGlobalsChanged

onGlobalsChanged: Signal<string>

Signal that is dispatched after the globals have changed.
A optional message is passed as an argument. Call the getGlobals() method to fetch new map objects to display on the host reference map.

onMeasureStateChanged

onMeasureStateChanged: Signal<string>

Signal that is dispatched after the measurement has changed.
A optional message is passed as an argument. Call the getMeasureState() method to fetch new map objects (inside the measure state) to display on the host reference map.

onOverlayObjectChanged

onOverlayObjectChanged: Signal<MapObject>

Signal that is dispatched when the viewer has edited an existing overlay map object.
The updated map object is passed as an argument.

onOverlayObjectCreated

onOverlayObjectCreated: Signal<MapObject>

Signal that is dispatched when the viewer has created a new overlay map object.
The new map object is passed as an argument and it only contains geometry, in the spatialPoint or spatialLine or spatialArea property of the map object. Make sure to call the addOverlayObjects method after initializing the objectId and graphic properties like color.

onOverlayObjectDeleted

onOverlayObjectDeleted: Signal<MapObject>

Signal that is dispatched when the viewer has deleted an existing overlay map object.
The deleted map object is passed as an argument.

onPickPositionCancelled

onPickPositionCancelled: Signal<string>

Signal that is dispatched when the viewer does not need the user to pick a location anymore.
A optional message is passed as an argument. Cancel any active pick function and return the host reference map to its default (pan) function.

onPickPositionRequested

onPickPositionRequested: Signal<string>

Signal that is dispatched when the viewer needs a location to be picked on the host reference map by the user.
A optional message is passed as an argument. When a location has been picked by the user, use the setPickPosition() method to pass it to the viewer.

onWorkspaceClosed

onWorkspaceClosed: Signal<string>

Signal that is disaptched when the workspace is closed.

onWorkspaceOpened

onWorkspaceOpened: Signal<string>

Signal that is dispatched when the workspace (and all resources in it) are open and ready for use.
Wait for this signal if you want to invoke actions.

onZoomToExtent

onZoomToExtent: Signal<Bounds>

Signal that is dispatched after the user requested an overview to the extent of a resource.
The spatial extent of that resource is passed as an argument. Zoom the host reference map to the given spatial extent.

Methods

Abstract addOverlayObjects

  • Adds a list of objects as overlays on the viewer. A resource for holding these map objects will be added to the workspace of the viewer if it does not exist yet.

    Parameters

    Returns void

Abstract addView

  • addView(position: Coordinate, renderMode: string, closeExistingViews: boolean): Promise<string>
  • Add a new view.

    Parameters

    • position: Coordinate

      The position to focus on (either 2D or 3D).

    • renderMode: string

      The render mode of the view to open. Have a look at the various RENDER_MODE_ values in the Constants class. Use RENDER_MODE_3D or RENDER_MODE_PHOTO_SPHERICAL for example.

    • closeExistingViews: boolean

      Should all existing views be closed?

    Returns Promise<string>

    Returns a promise that resolves with the viewId of the new view. The promise may fail with an Error. See the various ADD_VIEW_ERROR_ error code values in the Constants class.

Abstract addViewWithOptions

  • addViewWithOptions(position: Coordinate, renderMode: string, closeExistingViews: boolean, options: AMap<Object>): Promise<string>
  • Add a new view.

    Parameters

    • position: Coordinate

      The position to focus on (either 2D or 3D).

    • renderMode: string

      The render mode of the view to open. Have a look at the various RENDER_MODE_ values in the Constants class. Use RENDER_MODE_3D or RENDER_MODE_PHOTO_SPHERICAL for example.

    • closeExistingViews: boolean

      Should all existing views be closed?

    • options: AMap<Object>

      A map with options for the newly opened photo. Supported startup options are : Constants.STARTUP_PAN, Constants.STARTUP_TILT and Constants.STARTUP_FOV.

    Returns Promise<string>

    Returns a promise that resolves with the viewId of the new view. The promise may fail with an Error. See the various ADD_VIEW_ERROR_ error code values in the Constants class.

Abstract clearOverlayObjects

  • clearOverlayObjects(): void
  • Clear the list of overlay objects from the viewer.

    Returns void

Abstract doAction

  • doAction(action: string, argumentList: AList<Object>): Object
  • Perform an action. Note: This function is only for internal SDK use, application builders do not have to call it.

    Some actions are documented in the ViewerActions class.

    Parameters

    • action: string

      The action to perform.

    • argumentList: AList<Object>

      The arguments.

    Returns Object

    Returns the result.

Abstract getFieldOfViews2D

  • Get the field-of-view map objects to display on the host reference map.
    This method should be called after the onFieldOfViewsChanged signal has been received.

    Returns AList<MapObject>

    Returns the field-of-view map objects.

Abstract getFocusPosition

  • Get the current focus position of the viewer.

    Returns Coordinate

    Returns the current focus position (can be null).

Abstract getFootprints2D

  • Get the footprint map objects to display on the 2D host reference map.
    This method should be called after the onFootprintsChanged signal has been received.

    Parameters

    • viewbounds: Bounds

      the spatial bounds of the 2D host reference map.

    • scaleDenominator: float64

      the scale denominator of the 2D host reference map (like 1500.0 for example).

    Returns Promise<AList<MapObject>>

    Returns a promise to the footprint objects.

Abstract getGlobals

  • Get the global map objects to display on the host reference map. This method should be called after the onGlobalsChanged signal has been received.

    Returns AList<MapObject>

    Returns the global map objects.

Abstract getMeasureState

  • Get the state of the measurement and the map objects to display it on the host reference map. This method should be called after the onMeasureStateChanged signal has been received.

    Returns MeasureState

    Returns the current measure state (with embedded map objects) or null in case the measure function is not active.

Abstract getProperty

  • getProperty(propertyName: string): Object
  • Get a property. Note: This function is only for internal SDK use, application builders do not have to call it.

    Parameters

    • propertyName: string

      The name of the property.

    Returns Object

    Returns the property value.

Abstract setFocusPosition

  • Set the focus position of the viewer. Every view will bring this position into view (opening the closest or best photo as needed).

    Parameters

    • position: Coordinate

      The position to focus on (either 2D or 3D).

    Returns void

Abstract setFocusPositionWithOptions

  • setFocusPositionWithOptions(position: Coordinate, options: AMap<Object>): void
  • Set the focus position of the viewer. Every view will bring this position into view (opening the closest or best photo as needed).

    Parameters

    • position: Coordinate

      The position to focus on (either 2D or 3D).

    • options: AMap<Object>

      A map with startup options to apply to all views. Supported startup options are : Constants.STARTUP_PAN, Constants.STARTUP_TILT and Constants.STARTUP_FOV.

    Returns void

Abstract setPickPosition

  • Communicate a position that was picked by the user on the host reference map to the viewer. Calling this function only has effect when it is called after the onPickPositionRequested signal has been received.

    Parameters

    • position: Coordinate

      The user-chosen position on the host reference map.

    Returns void

Abstract setProperty

  • setProperty(propertyName: string, propertyValue: Object): void
  • Set a property. Note: This function is only for internal SDK use, application builders do not have to call it.

    Parameters

    • propertyName: string

      The name of the property.

    • propertyValue: Object

      The value of the property.

    Returns void

Abstract setSize

  • setSize(width: float64, height: float64): void
  • Update the size of the viewer when the host window has resized.

    Parameters

    • width: float64

      The new width (pixels).

    • height: float64

      The new height (pixels).

    Returns void

Abstract transformCoordinate

  • Transform a coordinate to a different CRS.

    Parameters

    • coordinate: Coordinate

      The source coordinate to transform.

    • targetCRS: string

      The target EPSG code.

    Returns Coordinate

    Coordinate The coordinate expressed in the target CRS.