Skip To Content

Configure a disconnected deployment for the JavaScript Viewer 4.3

Deployment in disconnected environments

The following need to point to local resources:

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

For more information on how to configure the resources and services in a disconnected portal, see Configure a disconnected deployment.

ArcGIS JavaScript API

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

  1. Determine the version of ArcGIS API for JavaScript in use by the application from the index.html file.
  2. Download the appropriate version of ArcGIS JavaScript API and deploy it to your web server.
    Remarque :

    If deploying ArcGIS JavaScript Viewer to Portal for ArcGIS, ArcGIS JavaScript API comes preinstalled at /portal/jsapi/jsapi4/. If the version of ArcGIS JavaScript API is not compatible with the version used in the application's index.html file, you may need to download and install the appropriate version.

  3. Modify the deployed index.html file and replace the references 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/jsapi4/esri/css/esri.css"> 
    <script type="text/javascript" src="//[your-server].[domain]/portal/jsapi/jsapi4/"></script>

ArcGIS services

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

Map services

When configuring your offline maps, you can configure the basemap toggle with tiled map services. The following information allows you to update the map section with your offline maps:

Basemap toggleDescription
map.basemapToggle

Specifies the properties for the basemap toggle widget for use with your offline maps. The widget only supports tiled map services.

For more information on supported basemap types, see BasemapToggle widget. For dynamic map service support, configure the custom basemap of the configuration file.

  • isEnabled—Specifics whether or not to enable the basemap toggle.
  • showArcGISBasemaps—Set to false since ArcGIS Online basemaps are not available offline.
  • defaultBasemap—Update your custom basemap name.
  • nextBasemap—Update with a secondary custom basemap name.
  • customBasemaps—Update to your local basemap services. Remove streets, hybrid, and topo 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

Specifies the properties for a non-tiled map service to be used as the application’s basemap. This configuration is used when the basemapToggle option is unavailable.

  • type—Specifies the type of the non-tiled map service. Supported types include mapimage and imagery.
  • properties.id—Specifies the ID of the map service.
  • properties.url—Specifies the REST URL of the map service.
  • properties.opacity—Specifies the opacity of the map service.
Remarque :

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

Geometry service

Use geometryServiceURL to update to a 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 for disconnected deployments. You will need to provide your own locator services in a disconnected deployment.

DescriptionLocator services
locatorSources

[your customized locator services]

For more information, see Search widget's sources property.

Third-party software

The JavaScript Viewer uses the online Font Awesome font and CSS toolkit. You need to download the 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. Modify the deployed index.html file.
  4. Replace the online Font Awesome 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">