Esri JS API - Local Stand-alone HTML

1191
2
Jump to solution
05-24-2013 02:09 PM
BrianRassier
Occasional Contributor
Hello -

We have a JS app that will need to function offline, and ideally it would function as a stand-alone html page (no IIS or other server).  Is it possible to package the Esri JS API in this way?  So that it really isn't hosted anywhere, but references are based on a local directory structure (e.g. c:\arcgis_js_v34_api\...).  The references could be absolute or relative to the stand-alone HTML page(s).

Thanks
-Brian
0 Kudos
1 Solution

Accepted Solutions
BrianRassier
Occasional Contributor
I found a way to get this to work.  Posting here in case others need the same result.


  1. Download JS API from Esri

  2. Follow the install.htm, but don't enter a "myserver" value when doing the search/replace.  Instead, use a relative path to the local JS API (e.g. "js/3.4/")

  3. Open the 2 files that were searched and replaced (init.js and dojo.js)

  4. Find the area with the text replaced from step 2, and remove the hard-coded values prior which will force "http://" to be prefixed on resources.

  5. Follow the rest of the install steps.  Now dojo and esri JS can be used with a stand-alone HTML file, without IIS, without a network connection.

View solution in original post

2 Replies
BrianRassier
Occasional Contributor
I found a way to get this to work.  Posting here in case others need the same result.


  1. Download JS API from Esri

  2. Follow the install.htm, but don't enter a "myserver" value when doing the search/replace.  Instead, use a relative path to the local JS API (e.g. "js/3.4/")

  3. Open the 2 files that were searched and replaced (init.js and dojo.js)

  4. Find the area with the text replaced from step 2, and remove the hard-coded values prior which will force "http://" to be prefixed on resources.

  5. Follow the rest of the install steps.  Now dojo and esri JS can be used with a stand-alone HTML file, without IIS, without a network connection.

MohammadAyub_Khan
New Contributor

I had to place the server name and then it worked. 

Going further it looks for the following URLs and breaks, since our ArcGIS server is not connected to internet and we want it to run local.

http://services.arcgisonline.com/ArcGIS/rest/info?f=json
http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json&callback=dojo.i...
http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServe...

0 Kudos