Even after layer is removed from a map popup remains open at the same place - ArcGIS 4.x

时间:2016-12-04 18:20:24

标签: javascript arcgis arcgis-js-api

Am using ArcGIS 4.x to draw a map. On button click, a feature layer is added. Popup template is initialized and added along with it. Now when I click on one of the features a popup opens displaying the layers features. Then a button is clicked for removing the layer. The layer is removed but the popup remains open at the same place.

Code for adding a layer : map.add(layer); For popup I use popupTemplate. Code for removing the same layer: map.remove(layer);

In 4.x is popuptemplate (infoWindow in 3.18) the right way to open a popup on layers ? How to make popup close automatically on map.remove(layer) ? I have already tried view.popup.close. It does not work.

0 个答案:

没有答案