Managing Interactions between Cities and Territories Apps

You can use the Publish/Subscribe protocol for your Cities and Territories apps to persist the changes made to the content of Geospatial experiences displayed in Cities and Territories apps the same way they are persisted when coming from the app's user interface. For more information on this protocol, see 3DEXPERIENCE Developer Assistance: Dashboard Apps JavaScript: Widget Interactions: Between Widgets: Using Publish/Subscribe Protocol.

Depending on the Preferences, Cities and Territories apps can communicate with other apps available on the same dashboard by publishing topics to inform other apps of status changes within the Cities and Territories apps. For example, when:

  • A Geospatial experience is loaded.
  • The camera was moved.
  • An item was selected.
Apps can also subscribe to predefined topics to let other apps take control of the Cities and Territories apps. For example, to move the camera to a specific location, or to change the visibility of one layer.

To keep messaging within the dashboard considered only by the intended target apps, Cities and Territories apps provide a pairing mechanism on top of the publish/subscribe protocol. The mechanism allows Cities and Territories topics to emit a message to the expected paired app, that should consider the message only if they are paired as well.


Before you begin: If you restore the Geospatial experience from 3DSpace without having previously saved it through the Save Experience or Save Experience As... command, changes made through the public API are lost when reloading the page.
  1. Load Geospatial Design.
  2. From the upper right corner, click Menu > Preferences.
  3. In the Subscribe Event list, click From paired widget only.
  4. Optional: Customize the widget title to avoid confusion with another Cities and Territories app on the same dashboard.
  5. Add or load the app that you want to pair.

    If the app supports the pairing mechanism, a button or an option to start the pairing with the Cities and Territories app appears. Otherwise, you can retrieve the title or identifier of the additional from the Cities and Territories app Preferences.

    The target app displays a dialog box to confirm the association with the source app.
  6. In the Cities and Territories app, click OK in the Widget Pair Request dialog box to approve the pairing.
  7. From the View section of the action bar, click Preferences .
    If the pairing is successful, the list of paired apps is displayed in the Paired Widgets list.

    Once the two apps are successfully paired together, they can exchange further messaging through different topics that are grouped into selectable levels of control:

    • Basic topics related to selection and click that occurs within the City viewer.
    • Basic topics related to the control of the camera location sent from another app.
    • Getter/setter allowing the additional app to modify the visibility or the rendering options of city datasets and items.
    Tip: If your dashboard is simple enough, the alternate Cities and Territories app option might be more relevant to interact with all apps located on the same tab, or even with all apps in the same dashboard.

    For more information about developing your own app to interact with Cities and Territories ones, see 3DEXPERIENCE Developer Assistance.

  8. To break the connection, click Remove from the Paired Widgets list in the experience Preferences.