Hi,
Without seeing the code, I suspect whats happening is that maybe you have done something like this when you set the JimuMapView.
activeViewChangeHandler = (jmv: JimuMapView) => {
if (!(jmv && jmv.view)) {
return;
}
this.setState({jimuMapView:jmv});
}
Or alternatively, you have set the view in state, eg
activeViewChangeHandler = (jmv: JimuMapView) => {
if (!(jmv && jmv.view)) {
return;
}
this.setState({jimuMapView:jmv.view});
}
In which case you have a JimuMapView in state, a JimuMapView is not the same as a MapView or a SceneView, you need to access the view property on the JimuMapView, in the example above where we set the JimuMapView in to state, it would then be,
//do this.
this.state.jimuMapView.view.graphics.add(graphic);
//not this
this.state.jimuMapView.graphics.add(graphic);
Or if you have set the view in to state, then its.:
//do this.
this.state.jimuMapView.graphics.add(graphic);
//not this
this.state.jimuMapView.view.graphics.add(graphic);
The details of the properties on a JimuMapView are here
If you see a message saying the a property doesn't exist, then I would recommend setting a breakpoint at the point where you are trying to access the object, and inspect it using the debugging tools in the browser. See an example below, where I have a breakpoint set as the JimuMapView is being checked. In the right hand pane, under Local section, you can see the details of the JimuMapView, you can see the methods and properties it has, you can see it has a view property, but not a graphics property.
The other thing I do a lot, is log stuff to the console so I can check the values of properties that have been set or to track my progress through code, simple as:
console.log(this.state.jimuMapView)
This way you can check that the value expect to be there, is the value you expect.
Hope that helps