Clear a basemap from the application.

4163
11
Jump to solution
05-24-2017 06:40 AM
Sai_AnandPeketi1
New Contributor III

Hello everyone, 

   By using the basemap widget, the user selects one base map and can change the base maps. Now, the user wants to clear base map from the base map widget.

Is it possible? If yes, How its can anyone share the code. M using the base map gallery sample Basemap gallery | ArcGIS API for JavaScript 3.20 

Thanks for the help.

0 Kudos
11 Replies
JerrySimmons_GISP
New Contributor III

Works with minor correction:

layer[i].title

0 Kudos
Sai_AnandPeketi1
New Contributor III

Instead of removing the base map. I added another base map and set the transparency level 100% in the base map gallery widget that resolved my problem. 

layers: [new esri.dijit.BasemapLayer({
URL: "http://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer",
opacity: "0"
})

0 Kudos