Customizing ExpB 1.14 experience with a custom Widget.
Hello ExpB Dev community. I don't know if my issue is conceptual (understanding how the technologies work) or syntactical (where I am holding my tongue while I type).
Bare Bones Question: How do I set up a eventlistener/ReactiveUtil/ to capture the ExpB Map Widget when toggling between the WebMaps that were loaded in the Map Widget Settings?
I can get the individual Web Maps:
const mapView = viewManager.getJimuMapViewById(viewManager.getAllJimuMapViewIds()[0])
const mapView2 = viewManager.getJimuMapViewById(viewManager.getAllJimuMapViewIds()[1])
I can query to see if mapView is active: if (!mapView.isActive) {return}
But I need to set new parameters as soon as the WebMap toggle happens.
I cannot get a ReactiveUtils or Eventlistener to fire when: mapView.isActive changes.
Line 1 and Line 2 below works. Line 3 does NOT work. Does not error, just does nothing.
reactiveUtils.when(() => mapView.view.interacting === true, () => alert("Interacting True"));
reactiveUtils.when(() => mapView.view.focused === false, () => alert("MapView:focused= false"));
reactiveUtils.when(() => mapView.isActive === false, () => alert("MapView:isActive = false"));
Line 1 and line 2 fire from the mapView.view object (view has interacting, focused properties)
Line 3 JimuMapView has the isActive property, but does nothing.
mapView is a JimuMapView object that has a 'isActive' property.
Longer explanation of task at hand.
I am constructing an experience (with custom widget) where the end user is supported with two different web Maps (with layers of information relating to the same location). The operational layers (polygon layers) for each WebMap are different. The background layers are also different for each WebMap. But the area of interest is basically the same (but the Map extent for each WebMap in the AOI is different).
I have configured the ExpB Map widget with the two WebMaps of interest. This adds a toggle button down on the lower left of the Map. Upon each click the user can switch between WebMaps with the WebMaps Extent synced for each WebMap.
The above works just fine.
Within my Custom Widget I am wanting to capture/monitor/watch/addListener to the toggling of the loaded WebMap in order to set specific settings in the Application. An example of this is changing the Home-Button to set extent back to main AOI of whichever map is currently loaded.
Thanks for any thoughts and ideas.
BobinTN