Select to view content in your preferred language

Using a web app template without Online/Portal

4453
2
Jump to solution
03-24-2015 09:50 AM
ToddBlanchette
Frequent Contributor

Hello all,

I'm playing around with the web app templates that are offered on ArcGIS Online.  What I'm trying to do is populate the map in the web app using a WMS service on my ArcGIS Server.  The issue I'm having is that the web app is looking for some form of "Map ID" that is usually found when you publish a map on ArcGIS Online or Portal for ArcGIS.  Is there an option to have the map just be based on the layers within the WMS?

Here's a few code lines from the default.js:

//default web map, default app color theme and more. These values can be overwritten by template configuration settings and url parameters.

    "appid": "",

    "webmap": "",

//Defaults to arcgis.com. Set this value to your portal or organization host name.

    "sharinghost": location.protocol + "//" + "",

I've tried setting the "sharinghost" to something like "myserver/arcgis/services/service/mapserver" in all kinds of variations, but just returns an error on the webpage:

Unable to create map: Unable to load http://myserver/arcgis/services/service/mapserver/sharing/rest/portals/self?f=json status: 403

Anyone know if what I'm trying to do is even possible?  And if so, how I might go about bypassing Online/Portal?

My thanks,

Todd

0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

You can specify the contents of a web map using json but you'll have to edit the template to support reading the web map contents from json instead of from a web map id.

Details on how to create a web map using json can be found here:

ArcGIS web map JSON format

And to see how to incorporate this into an existing template take a look at the Application Boilerplate code on github. In the boilerplate read me file look at the text under demoMap.js for an explanation of how you'd set it up to use a local web map. Once this makes sense you can update the template you are using to follow the same structure.  

View solution in original post

2 Replies
KellyHutchins
Esri Frequent Contributor

You can specify the contents of a web map using json but you'll have to edit the template to support reading the web map contents from json instead of from a web map id.

Details on how to create a web map using json can be found here:

ArcGIS web map JSON format

And to see how to incorporate this into an existing template take a look at the Application Boilerplate code on github. In the boilerplate read me file look at the text under demoMap.js for an explanation of how you'd set it up to use a local web map. Once this makes sense you can update the template you are using to follow the same structure.  

ToddBlanchette
Frequent Contributor

Thanks for the reply Kelly!

Some good stuff there and I'll definitely read up more on that process, but a lot of it is ArcGIS Online focused.  I'm specifically looking at being able to just use a barebones javascript api page that I can show the functionality of services that I've published on my local ArcGIS server.  Something like the Flex Viewer, where I can build a web app in 30 seconds to show an audience my feature service on a map background, but in JavaScript API.  I think that the Web App Builder in AGOL is like that, but that functionality (that I can see) isn't available without AGOL or Portal (neither of which I have).

0 Kudos