What is the 'sharinghost' setting in the Simple Map Viewer template?

2006
3
04-09-2014 05:25 AM
AnthonySchaffer
New Contributor III
Downloaded the simple map viewer template from GithHub to deploy a web map locally on our ArcGIS Server.   In the config/defaults.js file there is a sharinghost setting, which defaults to arcgis.com.   The comment there says to "set this value to your portal or organization host name".   During debugging I am seeing this being used to access REST urls that don't exist on our ArcGIS server (at AGS 10.1), so errors are being thrown although not to the end user.   If I set this to "" it causes other errors when attempting to parse this value elsewhere in the code.  Looking for clarification as to what this setting is intended for.  Thanks.
0 Kudos
3 Replies
RobertoPepato
Occasional Contributor II
Downloaded the simple map viewer template from GithHub to deploy a web map locally on our ArcGIS Server.   In the config/defaults.js file there is a sharinghost setting, which defaults to arcgis.com.   The comment there says to "set this value to your portal or organization host name".   During debugging I am seeing this being used to access REST urls that don't exist on our ArcGIS server (at AGS 10.1), so errors are being thrown although not to the end user.   If I set this to "" it causes other errors when attempting to parse this value elsewhere in the code.  Looking for clarification as to what this setting is intended for.  Thanks.


I think that it expects an url for a portal for arcgis instance (much like ArcGIS Online, but on premise), not an ArcGIS Server.
0 Kudos
AnthonySchaffer
New Contributor III
Thanks for the reply.   I was thinking that too but this option is not explained anywhere, and I would suspect it's obvious that many if not most sites will not have such a portal - so why require this to be specified?   It won't let me set that to "" (empty string) without throwing an error.
0 Kudos
KellyHutchins
Esri Frequent Contributor
When you download the application from github you shouldn't need to set the sharinghost value. It is defined in the defaults.js file and by default points to http://www.arcgis.com.

You can change this in cases where you want to retrieve settings from your organization for example if my organization was jsapi.maps.arcgis.com I'd change the sharinghost value to be as follows:



"sharinghost": location.protocol + "//" + "jsapi.maps.arcgis.com" 
0 Kudos