infoTemplate

819
2
Jump to solution
04-30-2014 06:08 AM
TimWitt
Frequent Contributor
Hey everybody,

Is there a way to turn of the infoTemplate property of a FeatureLayer via a button?

      var cities = new FeatureLayer(           "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0", {           mode: FeatureLayer.MODE_ONDEMAND,           infoTemplate:templateCity,           outFields: ["*"]       });


On start when I click on the city layer I want the popup to work, but when I push a button the popup won't work. How can I manipulate the infoTemplate property?

Thanks,

Tim
0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor
Hi Tim,

You can use the setInfoTemplate method to set the infoTemplate to null when the button is clicked.  Ex:

on(dom.byId('button'), 'click', function(){   cities.setInfoTemplate(null); })

View solution in original post

0 Kudos
2 Replies
JakeSkinner
Esri Esteemed Contributor
Hi Tim,

You can use the setInfoTemplate method to set the infoTemplate to null when the button is clicked.  Ex:

on(dom.byId('button'), 'click', function(){   cities.setInfoTemplate(null); })
0 Kudos
TimWitt
Frequent Contributor
As always, Jake to the rescue. Thanks!
0 Kudos