-
Notifications
You must be signed in to change notification settings - Fork 16
Description
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/