hi, i am new to this java script api.i want to turn on and off feature layer with check box.
my code is here ..
var finalurl = base_layer_url + '/?token=' + response.d.Result;
var featureLayer = new FeatureLayer(finalurl, {
mode: FeatureLayer.MODE_ONDEMAND,
outFields: ["*"]
});
// map.addLayer(featureLayer);
sessionStorage.setItem("pointurl", finalurl);
//line -layer//
var finalurl_line = base_layer_url_line + '/?token=' + response.d.Result;
var featureLayer1 = new FeatureLayer(finalurl_line);
// map.addLayer(featureLayer);
sessionStorage.setItem("lineurl", finalurl_line);
//polygon-layer//
var finalurl_poly = base_layer_url_poly + '/?token=' + response.d.Result;
var featureLayer2 = new FeatureLayer(finalurl_poly);
// map.addLayer(featureLayer);
sessionStorage.setItem("polyurl", finalurl_poly);
map.addLayers([featureLayer, featureLayer1, featureLayer2]);
anyone help me???