Need to reset setInfoTemplate ?

1146
3
11-30-2010 10:26 PM
zeeshanbhatti
New Contributor
Hi
I am initializing the symbols with popups on the map using setInfoTemplate to see detail info of the each symbol. I am succeed in removing particular symbol on hitting user defined button from the popup. Symbol removes successfully But popups remains viewable for user. How i can make popup close as well while removing symbol or how we can call CROSS button mentioned in the top right corner(which actually user hits to close). Looking sample code for my requirment. Thanks

Regards,
Zeeshan
0 Kudos
3 Replies
KellyHutchins
Esri Frequent Contributor
You can check to see if the map's info window is displayed using the InfoWindow's isShowing property. If the InfoWindow is visible you can then call the hide method.
0 Kudos
zeeshanbhatti
New Contributor
infowindow method use in the case when user want to get popup on map click ...but in my case i want popup on symbol click. i have checked to bind infowindow method while initializing symbol it not works.
I am sending my code :

            var pt = new esri.geometry.Point(X1, Y1, new esri.SpatialReference({ wkid: 4326 }));
            var symbol = new esri.symbol.PictureMarkerSymbol('primary_symbols/' + Img, 40, 30);
            var json = { title: "Telecom", content: "Details"}
            var info1 = new esri.InfoTemplate(json);

            var graphic1 = new esri.Graphic(pt, symbol);
            graphic1.setInfoTemplate(info1);
            map.graphics.add(graphic1);
0 Kudos
JasonMiller1
New Contributor
In the code that removes the symbol, just add something like this:


if (map.infoWindow.isShowing) {
map.infoWindow.hide();
}


That will hide the pop up.
0 Kudos