Skip to content

Support Reality Data location as initial viewer location #397

@ben-polinsky

Description

@ben-polinsky

Reality Data often has location data attached to it. This can be queried using RealityDataSource.getSpatialLocationAndExtents(). However, the RealityData client isn't fully initialized until iModelApp is initialized.

To initialize the iModelApp in our Viewer, we need to pass what we have deemed to be valid props. For "spatial" blank connections, this means a location and extents. And thus we have a chicken or the egg situation: iModelApp must be initialized before we can get location data, but we need the location data to initialize iModelApp.

A shabby workaround is to force a re-render of the viewer when the desired location data is returned from the RD client, supplying a dummy initial location to get iModelApp initialized in the meantime.

I need to take a closer look at iModelApp/RD initialization as well as how BlankConnections work in core to come up with a good solution - but perhaps separating iModelApp init into a hook could work.

Edit: here's the example I've whipped up with ugly initialization: https://github.com/ben-polinsky/reality-data-viewer-example/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions