AnsweredAssumed Answered

[JSAPI 4.8 vs 4.7] Popup empty after switching map

Question asked by Justdoit011 on Jul 10, 2018
Latest reply on Sep 28, 2018 by Justdoit011

I'm updating my app to use latest v4.8 JSAPI, while I found a potential bug of the API. In my application, user can switch different webmaps without refresh the page. However, after switching the webmap once, the popup window of the webmap become empty.

 

This issue does not exist in v4.7 API.

 

 

The issue only happens after changing "map" of a "view".

//change map
view.map = new WebMap({
  portalItem: {
    id: "f2e9b762544945f390ca4ac3671cfa72"
  }
});

 

If I create the view with WebMap in constructor, everything works fine. See the code below.

 

//do not change map
view = new MapView({
  container: "viewDiv"
  map: new WebMap({
    portalItem: {
      id: "f2e9b762544945f390ca4ac3671cfa72"
    }
  }),
});

 

Here is a running example:

https://codepen.io/anon/pen/RBwqjz

 

Steps to repeat the issue with this example:

  1. Wait for the page fully loaded
  2. Click "Switch Map" button
  3. Wait for the new Web Map fully loaded
  4. Click any graphics of the Web Map
  5. The first popup should look fine
  6. Close the popup
  7. Click any graphics, then the popup will be all empty

Outcomes