How to dynamically clear the FeatureLayer.popupTemplate

617
1
Jump to solution
04-12-2021 08:34 AM
ShaningYu
Frequent Contributor

In my App, I defined   myFeatureLayer.popupTemplate;

When I clear the loaded FeatureLayer, the popup still remains on the map.  I have tried the 3 methods below but not effective:

myFeatureLayer.popupTemplate = null;     // Not working

myFeatureLayer.popupTemplate.hide();   // error No such a method

myFeatureLayer.popupTemplate.close();    // error No such a method

How can it be dynamically close the popup?  Thanks.

0 Kudos
1 Solution

Accepted Solutions
UndralBatsukh
Esri Regular Contributor

Hi there, 

You should use MapView.popup.close or MapView.popup.visible properties to hide visible popups on the map. 

 

Hope this helps,

-Undral

View solution in original post

Tags (1)
1 Reply
UndralBatsukh
Esri Regular Contributor

Hi there, 

You should use MapView.popup.close or MapView.popup.visible properties to hide visible popups on the map. 

 

Hope this helps,

-Undral

Tags (1)