Error when reading app config from Arcgis Online

2187
3
05-28-2014 07:44 AM
PincoPalle
New Contributor
Hello,

I have deployed a map viewer based on this excellent swipe viewer.
Configuration is read from an arcgisonline application, through the appid parameter

However, I have found that some parameters are not correctly parsed

Starting in /Swipe/src/app/storymaps/core/Core.js, line 395, the response from the JSON app data is processed.

This code
var webmapsIds = WebApplicationData.getWebmaps(false);

should return an array with the webmap ids, but it returns the plain string (no splitting performed)
That causes the if()s in the following lines to behave unexpectedly, namely
411: if (webmapsIds && webmapsIds.length == 2

Besides, the other part of that if():
WebApplicationData.getDataModel()
Returns undefined, even if the app.model property is correctly set to �??TWO_WEBMAPS�?�

So it all goes through the wrong branch of the if() in line 425 and fails.


Am i missing something, or is there a specific way i should configure my app?


Sample app data:
http://www.arcgis.com/sharing/content/items/9af86922e9d94aceadf65acc6bb30b4d/data?f=json

Sample viewer:
http://storymaps.esri.com/templates/swipe/?appid=9af86922e9d94aceadf65acc6bb30b4d



Thanks, regards!
0 Kudos
3 Replies
MarkCooney
Occasional Contributor III
Hello,

Sorry you are experiencing trouble with the swipe app and it reading the app config information from AGOL.  Taking a look, the function should return an array instead of a string (and the webmaps paramter from AGOL should also be an array).  Are you using the swipe builder to populate the app config info, or another process?

-Mark
0 Kudos
PincoPalle
New Contributor
Thanks Mark,

The app config is being built with the generic ArcgisOnline template configuration tool, the one found in the item details page, when clicking on "Configure App" button.

I have checked the syntax in
http://doc.arcgis.com/en/arcgis-online/create-maps/configurable-templates.htm
but did not find a specific field type for arrays, that's what led me to use a comma-separated string.
Besides, the comma syntax is used in tabbed story template and side-by-side (or at least was, until recently)

I could use two parameters of type "webmap", but i think the template would not recognise that either.
0 Kudos
MarkCooney
Occasional Contributor III
Sorry for the confusion on the syntax.  The 'webmap' parameter is indeed a string and points to the app's 'root' webmap id.  There is also a parameter for when two web maps are used called 'webmaps' that is an array of web map ids.

-Mark
0 Kudos