Skip To Content

Configure a disconnected deployment for the JavaScript Viewer

Available with Workflow Manager license.

To deploy the JavaScript Viewer in a disconnected environment when there is no internet connection available, or internet access is prohibited by your organization, referenced sources need to be replaced with locally available sources.

Deploy in disconnected environments

The following is a list of items that need to be updated to point to local resources:

  • ArcGIS Maps SDK for JavaScript
  • ArcGIS services:
    • Maps
    • Geometry service
    • Locator services
  • Third-party software

Learn more about configuring resources and services in a disconnected portal

ArcGIS Maps SDK for JavaScript

Complete the following steps to determine, download, and modify the version of ArcGIS Maps SDK for JavaScript to be used:

  1. Determine the version of the JavaScript Maps SDK used by the application in the index.html file.
  2. Download the appropriate version of JavaScript Maps SDK and deploy it to your web server.
  3. Note:

    If the JavaScript Viewer is deployed to Portal for ArcGIS, JavaScript Maps SDK is installed in /portal/jsapi/jsapi/. If the version of the JavaScript Maps SDK is not compatible with the version used in the index.html file, you may need to download and install the appropriate version.

  4. Edit the deployed index.html file and replace the references shown below with locally installed versions.

    Replace the following:

    <link rel="stylesheet" href="//js.arcgis.com/[version]/esri/css/esri.css"> 
    <script type="text/javascript" src="//js.arcgis.com//[version]/"></script>

    With:

    <link rel="stylesheet" href="//[your-server].[domain]/jsapi/esri/css/esri.css"> 
    <script type="text/javascript" src="//[your-server].[domain]/jsapi/"></script>

    Or:

    <link rel="stylesheet" href="//[your-server].[domain]/portal/jsapi/jsapi/esri/css/esri.css"> 
    <script type="text/javascript" src="//[your-server].[domain]/portal/jsapi/jsapi/"></script>

ArcGIS services

Edit the deployed js/app/WorkflowManager/config/AppConfig.js file to reference local services.

Map services

Specify the properties for the basemap gallery widget for use with your offline maps. The widget only supports tiled map services. The following information allows you to update the map section with your offline maps:

Basemap galleryDescription
map.basemapGallery

The basemap gallery widget allows you to change basemaps in the JavaScript Viewer. The widget only supports tiled map services.

Learn more about supported basemap types

The following properties allow you to customize the basemap gallery widget for use with your offline maps:

  • isEnabled—This property allows you to turn the basemap gallery on or off.
  • showArcGISBasemaps—Set this property to false since ArcGIS Online basemaps are not accessible in a disconnected environment.
  • defaultBasemap—Update this property with the name of your custom basemap.
  • nextBasemap—Update this property with the name of your secondary custom basemap.
  • customBasemaps—Update this property with to point to your local basemap services. Remove streets, hybrid, and topographic basemaps that are references to ArcGIS Online services. The following is an example:

    customBasemaps : [
      {
        id: “localbasemap",
        title: "localbasemap",
        layers: [{
          url: "https://[hostname].[domain]/arcgis/rest/services/[localbasemap]/MapServer"
        }],
        thumbnailUrl: "js/widget/gis/BasemapGallery/images/localbasemap.jpg"
      }
    ]

Custom basemapDescription
map.customBasemap

The following properties allow you to configure a non-tiled map service to be used as the application’s basemap. This configuration is used when the basemap gallery option is unavailable.

  • type—Update this property with the type of non-tiled map service used by your custom basemap. Supported types include mapimage and imagery.
  • url—Update this property with the REST URL of your map service.
  • options.id—Update this property with the ID of your map service.
  • options.opacity—Specifies the opacity of the map service.
Note:

Other property configurations are available. Refer to the appropriate map service layer configuration for more options.

Geometry service

Update the geometryServiceURL parameter to use the local geometry service installed with ArcGIS Server. For example, http://[hostname].[domain]/arcgis/rest/services/Utilities/Geometry/GeometryServer.

Locator services

The default locator service is configured to use ArcGIS Online and is not accessible in a disconnected environment. Use the locatorSources parameter to provide your own locator services for a disconnected deployment.

DescriptionLocator services
locatorSources

[your customized locator services]

Learn more about the Search widget's sources property

Third-party software

The JavaScript Viewer uses the Font Awesome CDN.. You need to download the Font Awesome toolkit and deploy it locally for disconnected environments.

  1. Download Font Awesome version 3.2.1.
  2. Unzip and copy the folder to the deployment directory of your web application, for example, C:\Inetpub\wwwroot\wmviewer\font-awesome\ArcGIS\Portal\apps\workflow\font-awesome.
  3. Open the deployed index.html file in a text editor.
  4. Replace the Font Awesome CDN reference with any of the following locations:

    Replace the first example below with one of the two that follow it:

    Replace this example.

    <link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css">

    You can choose this to replace the example above.

    <link rel="stylesheet" type="text/css" href="//[hostname].[domain]/wmviewer/workflow/font-awesome/css/font-awesome.css">

    You can choose this to replace the example above.

    <link rel="stylesheet" type="text/css" href="//[hostname].[domain]/portal/apps/workflow/font-awesome/css/font-awesome.css">