1. Obtain ArcGIS javascript API
APIS.
2 Local deployment API
Open the arcgis_js_api/library/install.htm installation instructions in the API package. This article is based on the instructions in English.
Decompress the package and create an application in IIS, for example. After the API application is configured, its path is http: // 192.168.1.58/arcgis_js_api
ArcGIS JavaScript APIs include the common and simplified versions. The simplified version removes the dependency and non-essential ArcGIS jsapi classes of dojo digit.
Configure the common version:
Open arcgis_js_api \ library \ 3.2 \ jsapi \ init. js and replace [hostname_and_path_to_jsapi] With the deployment path of the API on the local machine. Here is 192.168.1.58/arcgis_js_api/library/3.2/jsapi/. Note that the path does not need to contain http ://.
Open c: \ arcgis_js_api \ library \ 3.2 \ jsapi \ JS \ dojo. js and replace [hostname_and_path_to_jsapi] With the deployment path of the API on the local machine. Here is 192.168.1.58/arcgis_js_api/library/3.2/jsapi/. Note that the path does not need to contain http ://.
Configure the simplified version (if you do not use the simplified version for development, you do not need to configure it ):
Open c: \ arcgis_js_api \ library \ 3.2 \ jsapicompact \ init. js and replace [hostname_and_path_to_jsapi] With the deployment path of the API on the local machine. Here is 192.168.1.58/arcgis_js_api/library/3.2/jsapicompact/. Note that the path does not need to contain http ://.
Open c: \ arcgis_js_api \ library \ 3.2 \ jsapicompact \ JS \ dojo. js in a text editor and replace [hostname_and_path_to_jsapi] With the deployment path of the API on the local machine. Here is 192.168.1.58/arcgis_js_api/library/3.2/jsapicompact/. Note that the path does not need to contain http ://.
So far, the development library has been configured. The following describes how to configure ArcGIS JavaScript browsing.
Configure ArcGIS JavaScript Browser
According to the installation instructions, open the desktop installation directory \ ArcGIS \ Taobao kit10.1 \ HELP \ rest \ index.html and find the section "installing the rest API". For more information, see the instructions, find the rest-config.properties file in the ArcGIS Server installation directory, open the modify js api URLs, its original value is:
jsapi.arcgis=http://serverapi.arcgisonline.com/jsapi/arcgis?v=2.6jsapi.arcgis.sdk=http://resources.esri.com/arcgisserver/apis/javascript/arcgisjsapi.arcgis.css=http://serverapi.arcgisonline.com/jsapi/arcgis/2.6/js/dojo/dijit/themes/tundra/tundra.css
Change the address of arcgisand arcgis.css to the API address we configured. The modified value is:
Jsapi. ArcGIS = http: // 192.168.1.58/arcgis_js_api/library/3.2/jsapi/ArcGIS /? V = 2.6
Jsapi. ArcGIS. SDK = http://help.arcgis.com/en/webapi/javascript/arcgis/
Jsapi.arcgis.css = http: // 192.168.1.58/arcgis_js_api/library/3.2/jsapi/ArcGIS/2.6/JS/dojo/dijit/themes/Tundra/tundra.css
After the modification, visit the sample map service http: // localhost: 6080/ArcGIS/rest/services/sampleworldcities/mapserver and click "ArcGIS JavaScript" to browse the sample map in the browser.