feature layer on off in javascript 3.38

114
0
11-25-2021 10:08 PM
priyammohanty
New Contributor

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???

0 Kudos
0 Replies