Basemap widget configuration

906
3
Jump to solution
07-27-2017 11:08 AM
SallieVaughn
Occasional Contributor

I'm working on my first application in WAB for Developers and have used the out of the box Basemap widget. After downloading the app, I customized the basemap widget configuration to re-order basemap items in the app and change out the thumbnails.

The basemap I'm using in the application is called 2013_Imagery and shows up in the basemap list with no thumbnail. I'd like to be able to rename this basemap and provide a thumbnail. However, I do not see that basemap listed in the config file. What gives? Where do I go to update this information?

0 Kudos
1 Solution

Accepted Solutions
SallieVaughn
Occasional Contributor

I figured this out. The Basemap widget automatically adds the basemap of the current webmap to the list shown in the widget. I turned off this functionality by commenting out the following lines in the Widget.js beginning on line 137.

// if basemap of current webmap is not include, so add it.
for(i = 0; i < basemaps.length; i++) {
  if (utils.compareSameBasemapByOrder(basemaps, webmapBasemap)) {
    break;
  }
}
if(i === basemaps.length) {
  basemaps.push(webmapBasemap);
}

View solution in original post

0 Kudos
3 Replies
RickeyFight
MVP Regular Contributor

Is this where you configured your widget? 

0 Kudos
SallieVaughn
Occasional Contributor

Initially, yes. And I did not add the 2013_Imagery there. It was already listed in the list of basemaps.

After downloading the app, I also changed configurations in the previously attached .json file but did't see 2013_Imagery in there to make the desired changes.

0 Kudos
SallieVaughn
Occasional Contributor

I figured this out. The Basemap widget automatically adds the basemap of the current webmap to the list shown in the widget. I turned off this functionality by commenting out the following lines in the Widget.js beginning on line 137.

// if basemap of current webmap is not include, so add it.
for(i = 0; i < basemaps.length; i++) {
  if (utils.compareSameBasemapByOrder(basemaps, webmapBasemap)) {
    break;
  }
}
if(i === basemaps.length) {
  basemaps.push(webmapBasemap);
}

0 Kudos