What is map and scene view
ArcGIS Experience BuilderJimu so widgets can work with a consistent extensibility model for map interaction, messages, and actions.
Interface and lifecycle
Jimu instances are created and managed by the Map widget.
- The Map widget creates
Jimuobjects for the configured web map or web scene.Map View - Other widgets do not create the map view directly in most workflows. Instead, they subscribe to and consume existing
Jimuinstances.Map View - At runtime, a widget can receive the active
Jimuand then interact with the underlying ArcGIS Maps SDK view.Map View
Properties
Jimu exposes several key properties:
view: The ArcGIS Maps SDK map view or scene view object.data: The web map or web scene data source ID that created the view.Source Id map: The ID of the Map widget that owns the view.Widget Id jimu: A collection of layer view wrappers associated with the view.Layer Views
How to use JimuMapView in widgets
If a widget needs a map or scene view, the common workflow is:
- In the widget settings page, use
Mapto let the author choose a Map widget.Widget Selector - Store the selected map widget ID in widget config.
- In runtime, render
Jimuand pass the selected map widget ID.Map View Component - Use the
oncallback to receive the currentActive View Change Jimu.Map View
If you need users to choose a specific view directly, you can also use Jimu in settings.
Code examples
Below is a minimal widget runtime example that gets the active Jimu and accesses the underlying ArcGIS Maps SDK view.
import { React, type AllWidgetProps } from 'jimu-core'
import { JimuMapViewComponent, type JimuMapView } from 'jimu-arcgis'
export default function Widget (props: AllWidgetProps<any>) {
const [jimuMapView, setJimuMapView] = React.useState<JimuMapView>(null)
const onActiveViewChange = (activeView: JimuMapView) => {
setJimuMapView(activeView)
}
return (
<div className='widget-map-scene-view'>
<JimuMapViewComponent
useMapWidgetId={props.useMapWidgetIds?.[0]}
onActiveViewChange={onActiveViewChange}
/>
{jimuMapView?.view && (
<div>
Active view type: {jimuMapView.view.type}
</div>
)}
</div>
)
}