Closing InfoTemplate Programmatically in ArcGIS API for JavaScript?

المشرف العام

Administrator
طاقم الإدارة
I am trying to hide a layer on the map like

var point = new esri.geometry.Point(-106.61, 35.1107); point = esri.geometry.geographicToWebMercator(point); var symbol = new esri.symbol.PictureMarkerSymbol("https://cdn1.iconfinder.com/data/icons/Map-Markers-Icons-Demo-PNG/128/Map-Marker-Marker-Outside-Chartreuse.png", 32, 32); pointInfoTemplate = new InfoTemplate(); pointInfoTemplate.setTitle("Project Details"); pointInfoTemplate.setContent('Some Att Here
'); var graphic = new esri.Graphic(point, symbol).setInfoTemplate(pointInfoTemplate); layer1 = new esri.layers.GraphicsLayer(); layer1.add(graphic); map.addLayer(layer1); $("#hide").on("click", function(){ layer1.hide(); }); which works fine but the InfoTemplate() remains in the map (in case of it being opened)





أكثر...
 
أعلى