JimuMapView

Class

JimuMapView is the view for developers to develop the map-related functions. For example, developers can use the view property of the JimuMapView instance to get the original ArcGIS API for JavaScript View, then use the original view to develop the map-related functions. At the same time, JimuMapView also provides properties such as isActive and status to indicate the current status in the map widget.

JimuMapView is a wrapper class for the ArcGIS API for JavaScript View. It is created by a map widget using a map DataSource.

Use dark colors for code blocks
                    
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { JimuMapView } from 'jimu-arcgis';

// Add the State interface
interface State {
 extent: __esri.Extent
}

// On an active view change, set the extent State property
onActiveViewChange = (jimuMapView: JimuMapView) => {
 if(!this.extentWatch){
  this.extentWatch = jimuMapView.view.watch('extent', extent => {
    this.setState({
      extent
    })
  });
 }
}

// Use the `JimuMapView` instance from the map widget through the `JimuMapViewComponent` React component
<JimuMapViewComponent useMapWidgetId={this.props.useMapWidgetIds[0]} onActiveViewChange={this.onActiveViewChange}></JimuMapViewComponent>

Constructors

new JimuMapView(optionsJimuMapViewConstructorOptions): JimuMapView
Parameters
ParameterType
options
JimuMapViewConstructorOptions
Returns 
JimuMapView

Properties

PropertyTypeNotes
string

The id of the DataSource selected to create the map.

string

The id of the JimuMapView instance.

isActive
 optional 
boolean

The isActive property indicates whether the map in the map widget is accessible. For example, for a single-source map, there is a single JimuMapView instance, therefore, the isActive is always true. With a multi-source map, there are two JimuMapView instances. In the multi-source map, the property isActive is true for the top JimuMapView instance, and false for the one beneath. Upon clicking the switch map tool, the isActive properties will switch.

jimuLayerViews
 optional 
{ [jimuLayerViewId: string]: JimuLayerView }

The union for all JimuLayerView instances and the layer view object wrapper.

string

The id of the widget creating the JimuMapView instance.

maxLayerIndex
 optional 
number

The maximum layer index in the JimuMapView.

The status of the JimuMapView instance. JimuMapViewStatus enumeration members include "LOADING", "LOADED" and "FAILED".

MapView | SceneView

The view is the ArcGIS API for JavaScript View, including aMapView or aSceneView. In the ArcGIS API for JavaScript, the MapView and SceneView are part of the __esri namespace types. Thus, their types are __esri.MapView and __esri.SceneView.

dataSourceId

dataSourceId: string

The id of the DataSource selected to create the map.

id

id: string

The id of the JimuMapView instance.

isActive optional

isActive: boolean

The isActive property indicates whether the map in the map widget is accessible. For example, for a single-source map, there is a single JimuMapView instance, therefore, the isActive is always true. With a multi-source map, there are two JimuMapView instances. In the multi-source map, the property isActive is true for the top JimuMapView instance, and false for the one beneath. Upon clicking the switch map tool, the isActive properties will switch.

jimuLayerViews optional

jimuLayerViews: { [jimuLayerViewId: string]: JimuLayerView }

The union for all JimuLayerView instances and the layer view object wrapper.

mapWidgetId

mapWidgetId: string

The id of the widget creating the JimuMapView instance.

maxLayerIndex optional

maxLayerIndex: number

The maximum layer index in the JimuMapView.

status

status: JimuMapViewStatus

The status of the JimuMapView instance. JimuMapViewStatus enumeration members include "LOADING", "LOADED" and "FAILED".

view

view: MapView | SceneView

The view is the ArcGIS API for JavaScript View, including aMapView or aSceneView. In the ArcGIS API for JavaScript, the MapView and SceneView are part of the __esri namespace types. Thus, their types are __esri.MapView and __esri.SceneView.

Methods

MethodReturnsNotes
void

Destroy the JimuMapView instance and the ArcGIS API for Javascript View at the same time.

drawDataOnMap(newShowOnMapDatas)
void

Draw data on the map, using a dedicated GraphicsLayerfor every data entry. This will clear the layers drawn previously.

drawFeatureSet(dataSource, records, targetLayerId, title?)
Promise<Graphic[]>

Draw the features in a GraphicsLayer.

getGraphicsFromRecords(dataSource, records)
Promise<Graphic[]>

Get the graphics from dataRecords

updateDrawFeatureSet(dataSource, records, targetLayerId, title?)
Promise<Graphic[]>

Update the drawn GraphicsLayer.

destroy

destroy(): void

Destroy the JimuMapView instance and the ArcGIS API for Javascript View at the same time.

Returns 
void

drawDataOnMap

drawDataOnMap(newShowOnMapDatasShowOnMapDatas): void

Draw data on the map, using a dedicated GraphicsLayerfor every data entry. This will clear the layers drawn previously.

Parameters
ParameterType
newShowOnMapDatas
ShowOnMapDatas
Returns 
void

drawFeatureSet

drawFeatureSet(dataSourceDataSource, recordsDataRecord[], targetLayerIdstring, title?string): Promise<Graphic[]>

Draw the features in a GraphicsLayer.

Parameters
ParameterType
dataSource
DataSource
records
DataRecord[]
targetLayerId
string
title
string
Returns 
Promise<Graphic[]>

getGraphicsFromRecords

getGraphicsFromRecords(dataSourceDataSource, recordsDataRecord[]): Promise<Graphic[]>

Get the graphics from dataRecords

Parameters
ParameterType
dataSource
DataSource
records
DataRecord[]
Returns 
Promise<Graphic[]>

updateDrawFeatureSet

updateDrawFeatureSet(dataSourceDataSource, recordsDataRecord[], targetLayerIdstring, title?string): Promise<Graphic[]>

Update the drawn GraphicsLayer.

Parameters
ParameterType
dataSource
DataSource
records
DataRecord[]
targetLayerId
string
title
string
Returns 
Promise<Graphic[]>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.