Startseite / Content / Building Hosted App Templates for ArcGIS Online

Building Hosted App Templates for ArcGIS Online

Dennis Payk May 29, 2013
As described in previous blog posts, it is possible to use map.apps as a web application template in ArcGIS Online. A new public demo is now available to show the workflow and benefits in a live demonstration. You may use our public hosted template to try using map.apps as a template to display your own web maps and configuring map.apps with means of ArcGIS Online or the integrated map.apps in-app configuration. All configuration will be stored in your own ArcGIS Online account. In summary, this post will describe how to publish an ArcGIS Online web map with help of a hosted template (map.apps) as an ArcGIS Online "Web Mapping Application". The following elements will be used:
  1. ArcGIS Online Web Map. You may use any web map, while in this description a map of a fictitious fire incident will be used.
  2. Hosted Template. A web application template will be generated, based on the following map.apps app: http://www.mapapps.de/mapapps/resources/apps/vsr_lab_public/index.html
  3. ArcGIS Online "Web Mapping Application". The result of combining a web map (1.) and the hosted template (2.) is a ready to use web mapping application, as you can see here: http://www.arcgis.com/home/item.html?id=3de1e7f353874b5e8897de6b0310545b
The following text describes the steps that have to be performed to get a result as in 3.) with your own web map and your own configuration of map.apps.
Please note

The map.apps app that is used in this sample, is a reduced version of the app that can be purchased in ArcGIS Marketplace.

Please consider the ArcGIS Online help for more information about Web Application Templates: http://resources.arcgis.com/en/help/arcgisonline/index.html#/About_web_application_templates/010q000000nt000000/.

Preparing ArcGIS Online Organization Settings

You have to modify the organization settings of your ArcGIS Online account to allow users in your organization to select configurable applications as application templates during the workflow "Publish a web map as web application" in ArcGIS Online. This is a global configuration of your organization and only users with administrative rights are allowed to perform this operation.

First create an empty group e.g. "map.apps-templates". This group is used in the organization settings as source for application templates.

Click on My Organization and then on Edit Settings.

Select Map and then select the group "map.apps-templates" in the select box of Web App Templates.

Registering map.apps Based "Web Mapping Application" Template

Go to My Content, click on Add Item.

In the dialog select An application, choose the option Web Mapping and enter the URL to your map.apps application, e.g. http://www.mapapps.de/mapapps/resources/apps/vsr_lab_public/index.html.

Please note: If you want to use your own map.apps instance, you have to ensure that your app is able to consume AGOL web maps.

To enable web map support, the map.apps app has to load the following bundles:

  • web map - enables the use of web maps in general
  • parametermanager - enables the use of URL parameters

It is important to choose Configurable in the purpose field.Enter a title and a tag and click Add Item.

Now the application is created in ArcGIS Online. The next preparation step is to tell ArcGIS Online what configuration parameters are possible.

Click on Edit and scroll down to the end of the page.

At the end of the page you find a section called Configuration Parameters. This section expects a JSON definition for possible configuration parameters.

A configuration JSON may look like the following sample, that defines three parameters:

  • title - Title of the application
  • theme - Name of the application style
  • appJson - A partial app.json as parameter, useable to overwrite any parameter in the app.json.
Configuration Parameters{ "configurationSettings": [{ "category": "General Settings", "fields": [ { "type": "string", "fieldName": "title", "label": "Title", "stringFieldOption" : "textbox" }, { "type": "options", "fieldName": "theme", "tooltip": "Style theme to use", "label": "Style:", "options": [{ "label": "Firefighter", "value": "flat_fw" }, { "label": "THW", "value": "flat_thw" }] }, { "type": "string", "fieldName": "dialIn", "label": "Voice Conference Number", "stringFieldOption": "textbox" } ] }], "values": { "title" : "", "theme": "flat_fw", "dialIn" : "+12 345 6789" } }

The last step is to Share the application with the group for templates created previously, e.g. "map.apps-templates".

After finishing these steps, you have registered a map.apps application as a hosted web application template in ArcGIS Online.

Publishing a Web Map Using a map.apps Based Hosted Web Application Template

To use the new web application template you need to publish a web map as a Web Mapping Application. You may select an existing web map and open it in the ArcGIS.com Map Viewer or create a new one. You may also use, this existing web map and save a copy of it to your account: www.arcgis.com/home/item.html?id=a0a3dae690294fe6aa88074263bb0791

Click on Share.

Click on Make a Web Application in the following dialog.

You have to share the web map with a group or your organization before you can click on Make a Web Application.

Now you will see the previously created map.apps based hosted web application template in the list of available templates.

Select the template and click on publish.

Select a title for the new application and Save and Publish it.

After this, you will get a short summary and you can click on go to the item now.

Configuring Your Application

Using ArcGIS Online

Because you have created an ArcGIS Online application based on a hosted and configurable template you get the button Configure App to jump to the ArcGIS Online preview mode of the application.

Because the new application is not public, you have to sign in with your AGOL account to see the preview.

At the right side of the screen you will see the possible configuration parameters that were defined for this hosted template.

As you can see in the upper right corner of your application, map.apps can directly access user details stored in ArcGIS Online such as full name, email address or profile image.

You can change the settings and click on Save to refresh the preview view on the left side.

If you are finished configuring the application you can click on cancel to get back to the ArcGIS Online item.

Using map.apps In-App Configuration

In addition to the ArcGIS Online mechanism described before, you can also use map.apps's integrated app.builder to configure details of your application. To start in-app configuration click on the Configure app in the lower left corner of your app configuration.

Please note, that you have to be the owner of the app and the app is not yet shared to "public". Otherwise the Configure app button will not appear.

After clicking on the button, you can configure your application with all possibilities provided by map.apps.

Once you have finished configuration click on Update Preview to refresh the app.

If you are finished configuring the application you can click on Save App to persist your configuration changes. These changes will now be stored directly in ArcGIS Online in combination with your App ID. If you open the map.apps application without appending the appid parameter you will see, that the changes you made are not active.

The last step is to share the application with your organization or the public.

After this, the URL can directly be opened in any browser: http://www.mapapps.de/mapapps/resources/apps/vsr_lab_public/index.html?&appid=3de1e7f353874b5e8897de6b0310545b

As a registered member of the con terra Developer Network, you can find more information about using custom hosted templates in ArcGIS Online here: http://developernetwork.conterra.de/documentation/mapapps/developers-documentation/arcgis-online-web-application-templates