How to clear popup user storage

414
0
12-06-2019 02:58 PM
GregoryBologna
Occasional Contributor II

I have a custom popup for when a map is not available in ArcGIS. Each time the map is loaded in this situation, the popup opens. The popup is closed on popup.watch("visible", function (newVal). As part of the customization, I am removing the popup pointer class since there is nothing to point at. I handle this by adding a class "map-not-found-popup" and look for it in the watched event.

The trouble I am having is that each time the popup opens, a new user storage is added. How do I stop or clear it?

          popup.watch("visible"function (newVal) {
            var nomap = $('.map-not-found-popup');
            if(newVal) {    // open
              // remove popup pointer if map not found
              if(nomap && nomap.length>0) {
                $('.esri-popup__pointer').addClass('d-none');
              }             
              // other handling
              closeExpandedWidgets();
            } else {    // closed
              // remove popup from dom when closed
              if(nomap && nomap.length>0) {
                popup.clear();
              }
              // reset popup properties
              setPopupDefaultProperties();
            }
          }); // end popup.watch

0 Kudos
0 Replies