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".
view.map = new WebMap({
portalItem: {
id: "f2e9b762544945f390ca4ac3671cfa72"
}
});
If I create the view with WebMap in constructor, everything works fine. See the code below.
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:
- Wait for the page fully loaded
- Click "Switch Map" button
- Wait for the new Web Map fully loaded
- Click any graphics of the Web Map
- The first popup should look fine
- Close the popup
- Click any graphics, then the popup will be all empty