Skip to main content
Version: v5.1

ArcGIS and IafViewer

Overview#

ArcGIS is a technology which connects locations and data using interactive maps. For more information, refer to the ArcGIS web page. This page describes how the ArcGIS Viewer is implemented in the IafViewer.

Terminology#

Is is important to understand the following terms in relation to how the IafViewer supports ArcGIS.

TerminologyDescription
ApplicationYour application code which consumes the IafViewer
IafViewerThe viewer component (IafViewer) which wraps the ArcGIS Viewer. This is the primary interface your application interacts with, via props and callbacks.
EVM UI WidgetsThe UI components of IafViewer (viewer widgets, toolbar, controls, etc.). IafViewer props interface and UI interface drive the IafViewer state.
ArcGIS ViewerThe ArcGIS SceneView instance (internal to IafViewer, not directly accessed by applications).
ArcGIS SceneViewThe ArcGIS SceneViewer renders 3D geospatial content. It is internal to the IafViewer and is accessed via the onIafMapReady callback

Overall Architecture#

The IafViewer wraps the ArcGIS Viewer and ArcGIS SceneView. Your application then interfacts with the IafViewer via React props and callbacks.

Communication between application and IafViewer as ArcGIS#

The visibility of IafViewer's EVM UI Widgets toolbar is controlled via showToolbar.

Note the following:

  • When showToolbar is set to true: Shows IafViewer's EVM UI Widgets toolbar (buttons for maximize, minimize, split, zoom in/out, close)
  • Toolbar button clicks: When EVM UI Widgets toolbar buttons are clicked, The IafViewer updates its internal state (for example, displayMode), which is passed as props to control the ArcGIS Viewer.
  • 3D scene interfactions: 3D scene interactions (clicks on 3D elements, camera movements) within the ArcGIS SceneView send events from IafViewer to your application's eventHandler callback. However, ArcGIS SceneView UI widget interactions (basemap gallery, search widget, etc.) are handled internally by IafViewer and are not forwarded to the application.
  • Command flow: Commands flow from your application to IafViewer when the command prop is updated.

Event handling and callbacks#

The eventHandler callback signature is:

(event: EventObject) => void

Event object structure#

Note the event object structure below.

{  eventSourceGuid: string,        // Container ID or EVM ID of the event source  eventName: string,              // Event name (see EvmUtils.EVM_EVENTS)  payload: {                      // Event-specific data    action?: string,              // Action type (e.g., "click", "doubleclick", "mousemove")    elements?: Array<{           // Array of elements involved in the event      id: string,                 // Element identifier      elementType: string,        // Type of element (gis_building, district, etc.)      position: {                 // 3D position with multiple coordinate systems        x: number,        y: number,        z: number,        latitude?: number,        longitude?: number,        altitude?: number      },      extra?: object              // Additional element-specific data    }>,    modifiers?: {                 // Keyboard modifiers      shift: boolean,      ctrl: boolean,      alt: boolean    },    screen?: {                    // Screen coordinates      x: number,      y: number,      all?: {        screenX: number,        screenY: number,        scaledScreenX: number,        scaledScreenY: number,        viewPortWidth: number,        viewPortHeight: number      }    },    position?: {                  // Camera position (for CAMERA_UPDATE events)      x: number,      y: number,      z: number,      latitude?: number,      longitude?: number,      altitude?: number    },    rotation?: {                  // Camera rotation (for CAMERA_UPDATE events)      pitch: number,      yaw: number,      roll: number    },    ready?: boolean,              // For VIEWER_READY events    scene?: object,               // Scene instance (for VIEWER_READY events)    sceneView?: object,           // SceneView instance (for VIEWER_READY events)    command?: object,              // For COMMAND_RECEIVED events    commandRefs?: string[],        // Array of command reference UUIDs    [key: string]: any             // Additional event-specific properties  }}

Available Event Names#

The available event names from EvmUtils.EVM_EVENTS are:

  • CAMERA_UPDATE: Camera position or rotation changed
  • SELECTION_UPDATE: Element selection changed (click, doubleclick)
  • POINTER_MOVE: Mouse pointer moved
  • POINTER_EXIT: Mouse pointer exited viewer
  • POINTER_ENTER: Mouse pointer entered viewer
  • VIEWER_READY: Viewer is ready and initialized (payload.ready: true/false, payload.scene, payload.sceneView)
  • VIEWER_BUSY: Viewer is busy processing
  • VIEWER_ERROR: Viewer encountered an error
  • COMMAND_RECEIVED: A command was received and processed
  • LAYERS_UPDATE: Layer visibility or configuration changed
  • GRAPHIC_ADDED: A graphic element was added
  • GRAPHIC_DELETED: A graphic element was deleted
  • GRAPHIC_UPDATED: A graphic element was updated