How do I temporarily disable web map popup?

4286
7
Jump to solution
08-15-2013 12:03 PM
JeffJacobson
Occasional Contributor III
I have a web application that uses a web map from ArcGIS Online that has popups defined. Is there a way to disable these popups temporarily (when the user is drawing geometry using the Draw toolbar)?

Edit:

I found the answer to my question here:
http://forums.arcgis.com/threads/90208-Unable-to-toggle-webmap-popups
0 Kudos
1 Solution

Accepted Solutions
JeffJacobson
Occasional Contributor III
I found the answer in this thread.

Thanks.

View solution in original post

0 Kudos
7 Replies
SteveCole
Frequent Contributor
I don't know about disabling the popups but you can always add some contingency code to hide the popups when you would want-


  1. Add global boolean variable such as "var hidePopup = false;"

  2. At the start of when you'd like to not have popups show up, calc the variable to true: 'hidePopup = true;"

  3. when the process of hiding the popup is done, just calc the variable back to false

  4. Lastly, in your listener function for the features add some code such as:

dojo.connect(theFeatureLayer, "onClick", function() {
    if (hidePopup) {
       map.infoWindow.Hide();
    } else {
       etc....
    }
});


Steve
0 Kudos
JeffJacobson
Occasional Contributor III
Steve,

Unfortunately, I do not have a feature layer "click" event defined in my code. The popup is defined in an ArcGIS Online web map. In my code I call the arcgisUtils.createMap function and pass in the ID of the web map. This function creates the popups, so I don't have a "click" event handler in my code to modify.
0 Kudos
SteveCole
Frequent Contributor
Ok, shoot, now I see the problem you have. I don't have any experience working with an imported webmap like you describe so hopefully someone else can chime in!
0 Kudos
SteveCole
Frequent Contributor
I was curious so I did some searching in the forum. I found this thread which addresses another issue about webmap layers but I thought that it might be a way to "hook" into the layer you need to hide your popups.

Once you have that link to the layer,  maybe then you can follow the advice I originally gave? (I'm just grasping at some straws for ya :D)

Steve
0 Kudos
JeffJacobson
Occasional Contributor III
I found the answer in this thread.

Thanks.
0 Kudos
JasonZou
Occasional Contributor III
Try this:

Hide the infoWindow when the edit toolbar is activated;
var infoWinCopy = map.infoWindow;
aspect.before(drawTool, "activate", function() {
[INDENT]map.infoWindow = null;[/INDENT]
});


Restore the infoWindow when drawing is completed.
drawTool.on("drawEnd", function() {
[INDENT]map.infoWindow = infoWinCopy;[/INDENT]
});
ChristinaMosnick
New Contributor II

Updated link to answer posted by Jeff: https://community.esri.com/message/339184?commentID=339184