Solved! Go to Solution.
But clicking on a graphic would then also constitute a click on the map
dojo.connect(map, "onClick", function(evt) { if(!evt.graphic) { console.log("map click"); } });
I tried setting a dojo.connect event handlers like dojo.connect(map, "onClick", map.infoWindow.hide()); but that doesn't seem to work.
dojo.connect(map, "onClick", function() { map.infoWindow.hide(); });
dojo.connect(map.infoWindow, "onShow", function() { dojo.connect(map, "onClick", function() { map.infoWindow.hide(); }); });
That just seems to hide the infoWindow as soon as it's shown - it's only up for a second.
But clicking on a graphic would then also constitute a click on the map
dojo.connect(map, "onClick", function(evt) { if(!evt.graphic) { console.log("map click"); } });
function hideInfoWindow(){ map.infoWindow.hide(); }
Thanks Steven! That did it!
dojo.connect(map, "onClick", function(evt) { if(!evt.graphic) { console.log("map click"); } hideInfoWindow(); }); function hideInfoWindow(){ map.infoWindow.hide(); }
dojo.connect(map, "onClick", function(evt) { if(!evt.graphic) { map.infoWindow.hide(); } });