Skip To Content

Configure a disconnected environment for the JavaScript Viewer

Disponible avec une licence Workflow Manager.

The JavaScript Viewer can be configured to use local resources in a disconnected environment where there is no internet connection available or internet access is prohibited by your organization.

The following items must be configured to point to local resources for a disconnected deployment of the JavaScript Viewer:

  • ArcGIS Maps SDK for JavaScript
  • ArcGIS services:
    • Maps
    • Geometry service
    • Locator services
  • Font Awesome CDN

Learn more about configuring resources and services in a disconnected portal

Download and modify the version of ArcGIS Maps SDK for JavaScript

Complete the following steps to download and modify the version of JavaScript Maps SDK:

  1. Open the index.html file and determine which version of JavaScript Maps SDK is compatible with the JavaScript Viewer.
  2. Download the appropriate version of JavaScript Maps SDK and deploy it to your web server.
    Remarque :

    A version of JavaScript Maps SDK is preinstalled with Portal for ArcGIS at Https://[hostname].[domain]/portal/jsapi/jsapi/.If the version of the JavaScript Maps SDK does not match the version listed in the index.html file, download and install the appropriate version.

  3. Edit the index.html file with a text editor and replace the references shown below with versions installed locally.

    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="//[hostname].[domain]/jsapi/"></script>

    Or:

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

ArcGIS services

Modify the js/app/WorkflowManager/config/AppConfig.js file to point to local services.

Map services

To use maps offline, modify the map section to reference local services. The following tables describe properties to configure tiled or nontiled map services for offline environments:

Basemap galleryDescription
map.basemapGallery

The following properties allow you to configure a tiled map service to be used as the basemap for the JavaScript Viewer. The widget only supports tiled map services.

Learn more about supported basemap types

  • isEnabled—Set this property to enable or disable a map gallery for selecting basemaps.
  • showArcGISBasemaps—Set this property to false for disconnected environments. By default, this property is set to true to reference map services in ArcGIS Online.
  • defaultBasemap—Update this property with the name of your custom basemap. This property sets the default basemap for the basemap gallery.
  • customBasemaps—Update this property 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 nontiled map service to be used as the basemap for the JavaScript Viewer. Use this configuration when basemapGallery is not enabled.

  • type—Update this property with the type of nontiled map service used by your custom basemap. Supported types include dynamic 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—Specify the opacity of the map service.
Remarque :

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 available in a disconnected environment. Use the locatorSources parameter to provide your own locator services for a disconnected deployment.

DescriptionLocator services
locatorSources

An array of custom locator sources used to find search results.

Learn more about customizing locator sources using the search widget

Download and deploy Font Awesome

The JavaScript Viewer uses the Font Awesome CDN. You must 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 app, 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:

    Replace the following:

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

    With:

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

    Or:

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