empty JimuLayerViews after creating JimuMapView using WebMap ID

138
3
Thursday
MohammedHilal_K
New Contributor III

Hi Team,

am developing an custom widget which can switch the webmap dynamically. Successfully am able to switch the webmap, but i noticed, after switching the webmap, selection on features is not working. So I did some research and find something like need to create jimuMapView to solve this. I could able to create a JimuMapView. But theres is no JimuLayerView and Maptool. Any help would be appreciated.

 

thanks & regards,
Mohammed Hilal K

0 Kudos
3 Replies
QunSun
by Esri Contributor
Esri Contributor

Hi MohammedHilal_K,

Currently only Map widget can create JimuMapView. Can you share your code to create JimuMapView in the custom widget ?

 

0 Kudos
MohammedHilal_K
New Contributor III

hi @QunSun,

Here is the code where I'm trying to create a JimuMapView. I'm not sure this is the correct method to do.

let jmvConstructorOptions:JimuMapViewConstructorOptions={
  view:views.view,
  dataSourceId:webmapId,
mapWidgetId:"widget_23",
mapViewManager:mvManager,
  }
mvManager.createJimuMapView(jmvConstructorOptions).then(newJMV)

here, I'm passing WebMapId as dataSourceId. 

Actually my requirement is to make the feature layer selectable even after switching the map programmatically. May be if I can change the Map Widget data source, I could resolve my issue. Can you help me out? 
0 Kudos
QunSun
by Esri Contributor
Esri Contributor

Hi MohammedHilal_K,

The webmapId is not the correct dataSourceId. Data source is a concept in Experience Builder. The only way to select a webmap/webscene data source is using the left data panel.

QunSun_0-1719296879642.png

Then you can check the dataSourceId by _appState.appConfig.dataSources in the console.

QunSun_1-1719296996660.png

Here is an example. The dataSourceId of the webmap is "dataSource_1", not the webmapId "33e58168249b42d49c4fb1b4f27728db".

0 Kudos