I am attempting to allow for the pop-up to be toggled on and off by pressing a checkbox. Here are some snippets of the code:
var clickHandler
function popupOn(evt){
var query = new esri.tasks.Query();
query.geometry = pointToExtent(map,evt.mapPoint,10);
var deferred = featureLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW);
map.infoWindow.setFeatures([deferred]);
map.infoWindow.show(evt.mapPoint);
}
function clickConnect(connect){
if(connect){
//perform the identify task on click
clickHandler = dojo.connect(map, "onClick", popupOn);
}
else{
//disconnect the click handler
dojo.disconnect(clickHandler);
clickHandler = null;
}
}
No comments:
Post a Comment