clear map.graphics when infoWindow is closed

461
2
03-31-2011 05:57 AM
RyanClancy
Occasional Contributor
Hi,

I've got an Identify Task that opens an infoWindow and highlights the clicked feature using a map graphic. I want to clear the graphic when the infoWindow is closed but can't get it to work. I tried using onHide() with no success:

map.infowWindow.onHide(clearGraphics);

function clearGraphics() {
     if (map.graphics) {map.graphics.clear()};
}


Any ideas?
0 Kudos
2 Replies
HemingZhu
Occasional Contributor III
Hi,

I've got an Identify Task that opens an infoWindow and highlights the clicked feature using a map graphic. I want to clear the graphic when the infoWindow is closed but can't get it to work. I tried using onHide() with no success:

map.infowWindow.onHide(clearGraphics);

function clearGraphics() {
     if (map.graphics) {map.graphics.clear()};
}


Any ideas?


try this instead of map.infowWindow.onHide(clearGraphics): dojo.connect(map.infoWindow, "onHide", clearGraphics);.
0 Kudos
RyanClancy
Occasional Contributor
Success! Thanks!
0 Kudos