I try to use map.setInfoWindowOnClick disable pop up window when drawing features, but it does not work. Sample like this one: ArcGIS API for JavaScript Sandbox, I open dev tool and use map.setInfoWindowOnClick(false), but the popup still can be show. Is there a way to disable the popup?
Thanks,
Yuki
Solved! Go to Solution.
Yuki,
For clusterlayer specifically you need to use:
clusterLayer.disableMouseEvents();
otherwise
map.setInfoWindowOnClick(false);
works fine.
Add this to ur code, if that helps u, please mark this answer as a correct
clusterLayer.on('click',function(e){
map.infoWindow.hide();
});
Yes, your solution is somehow correct, but the problem is that this would block the pop-up forever, should be a way like .off(event). BTW, the feature is still clickable, I really want to click action does not even click the feature. Anyway, thanks a lot.
Then , I didnt understand what u wanna do >.<
Actually, I want to use Draw Tool to create features on the map, but it turns out that if I cross any feature layers or other layers on the map, related popups will show which is really annoying. So I want to disable the popups during the drawing.
I found a solution is that use pop-up manager:
1. arcgisUtils.createMap(webMapId, "map", {mapOptions: mapOptions, usePopupManager: true}
2. map.setInfoWindowOnClick(false)
It works out when the map is created via web map id.
The remaining problem is that I need to implement the map that created by new Map().
P.S. The problem that I want to deal with is a little bit tricky ~_~
Yuki,
When you add map.setInfoWindowOnClick(false); to line 74 of this sample it works fine:
https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=popup_chart
Do you specifically need it to work with the cluster layer sample? If that is the case then you need to use clusterLayer.disableMouseEvents(); and then re-enable them when done drawing.
Robert,
Thank you for your reply. Right now, only cluster layer, but I need to handle layers like feature layers, graphic layers, and KMLs. I have tried some examples provided in documents. Besides the feature collection example, ArcGIS API for JavaScript Sandbox , which would show a light blue box of the feature, all others work perfectly.
I think it might be due to some quirk behaviors in my app...
Yuki,
For clusterlayer specifically you need to use:
clusterLayer.disableMouseEvents();
otherwise
map.setInfoWindowOnClick(false);
works fine.