How can I add multiple webmaps to an ArcGIS Online Configurable App Template?

1424
5
05-26-2016 07:01 AM
RobertWinterbottom
Occasional Contributor

Hi,

I have built a custom app template with a bunch of configuration parameters and was wondering if we could use the Web Map Dialog to choose multiple web maps.  According to Add configurable parameters to templates—ArcGIS Online Help | ArcGIS,​ we can add a

{
     "type": "webmap"
}

to our configuration file and the user gets a nice dialog to choose their Web Map, and this works great, but is there a way we could use this to select multiple Web Maps?  I was hoping something like this would work but we are not having much luck.

{
     "type": "webmap",
     "fieldName": "webmap"
}, {
     "type": "webmap",
     "fieldName": "alternateWebmap"
}

It seems like when I use the second web map dialog, it just sets the first web map and never allows me to set the second one.

0 Kudos
5 Replies
RobertWinterbottom
Occasional Contributor

UPDATE:  A workaround we are considering but hoping to avoid is using a string and having the user manually enter their Web Map id as a string.  This would work but would not be as nice as using the Web Map dialog.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Robert,

  The JS API Map object is not capable of use to different web maps. Your best development solution would be to parse the web maps operational layers and basemaps for each web map and concatenate then and manually add them to the Map Object (this is theory speak, as I have never had the need to do this).

0 Kudos
RobertWinterbottom
Occasional Contributor

Thanks for the reply Robert.  We are actually not trying to use two Web Maps with the same map object, just allow the user to configure two of them in the application template.  Our application supports multiple languages and what we are trying to do is have the user create two Web Maps, one in English and one in an alternate language.  Then we load the default web map and when they toggle languages, we destroy that map and create another one with the other web map id.  This part actually works really well, the part we are having troubles with is ArcGIS Online allowing multiple web maps to be configured through ArcGIS online using the Web Map Dialog picker.  This way our users do not have to download the codebase and configure it manually themselves.

P.S.  Parsing the operational layers works pretty well, we are doing that to create a custom TOC widget to control the layers from the web map plus some defaults that we added, and when we change web map id's, we just re-render the TOC (it's a React component), and it works perfectly with the new web map.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Robert,

  OK, I will bow out of this thread then as I have next to zero experience with in this area.

0 Kudos
RobertWinterbottom
Occasional Contributor

Thanks anyway. I just found the ArcGIS Online space and am thinking I should have actually posted this over there since this is more a question about configurations through an ArcGIS Online Custom template, I may start a new thread over there and link this one.