3

I created an app in the Web AppBuilder v2.0, running at http://my-PC:3344/webappbuilder, and included the standard BaseMap Widget.

I downloaded the resulting app and deployed it using IIS at C:\inetpub\wwwroot\MyApp. I've subsequently made some changes by editing the JS files directly in an IDE (not via the Web AppBuilder UI) and it's all working fine.

Now I'd like to change the default basemap which is shown when the app opens.

  • \MyApp\config.json lists the BaseMapGallery widget
  • \MyApp\configs\BasemapGallery\config_BaseMap Gallery.json lists the available basemaps
  • neither file seems to configure the default basemap

Which files should I edit to change the default basemap?

Edit: I am using the LocalLayer widget to specify the map layers manually

  • Isn't the default basemap determined by the basemap of the webmap you are consuming in the WAB application? – Chad Cooper Jun 16 '16 at 3:48
  • @ChadCooper you may be onto something. I've edited the question to note that I'm using the LocalLayer widget, and not specifying an Esri map, to configure the active layers. If you put that as an answer, I'll accept it as I think it's the way to go – Stephen Lead Jun 16 '16 at 4:14
  • @chad sorry, Pavel beat you to it ;) – Stephen Lead Jun 16 '16 at 5:19
2

Preparation: (1) change basemap of your AGOL map, or (2) make several AGOL maps with different basemaps. The latter is more work and it might be more money if you pay for data stored in them, but it's more elegant.

I didn't test the first case, it might take some time until the new basemap gets applied, but if you need to change the basemap just once in a longer time, it should be OK. Forbiding your browser's caching should make it faster.

In the latter case you have two options: you can just add itemid={mapIDfrom AGOL} into the querystring and reload. This should be OK in most cases. Or, if you incorporate your WAB into some other app (as I do), you might make dynamic the map.itemInfo property in Jimu.js/mapManager.js, line 318 or something like this.

  • yep, it turns out that the basemap is specified in the map: itemID section of MyApp\config.json, so to change the default basemap while using the Local Layer widget you need to create an ArcGIS Online map containing only the desired basemap – Stephen Lead Jun 16 '16 at 5:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.