When using the server, you may find that you can browse the map in Javascript mode in the rest address. You need to compute the map and use it in the case of Internet connection. The reason is that you have called the online javascript API, next, let's look at how to make the server use the local API.
First download js api: http://www.esri.com/apps/products/download/index.cfm? Fuseaction = download. All # arcgis_api_for_javascript. The installation and installation documentation must complete API configuration.
Copy\arcgis_js_api\library
And all its contents from the DVD to your web server. In this example the files are copied
C:\Inetpub\wwwroot\arcgis_js_api\library
Configuration Options for normal build:
- OpenC: \ Inetpub \ wwwroot \ arcgis_js_api \ library \ 3.0 \ jsapi \ init. jsIn a text editor and search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, And replace this text"<myserver>/arcgis_js_api/library/3.0/jsapi/"
- OpenC: \ Inetpub \ wwwroot \ arcgis_js_api \ library \ 3.0 \ jsapi \ JS \ dojo. jsIn a text editor and search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, And replace this text"<myserver>/arcgis_js_api/library/3.0/jsapi/"
- OpenC: \ Inetpub \ wwwroot \ arcgis_js_api \ library \ 3.0 \ jsapi \ JS \ dojo. js. uncompressed. jsIn a text editor and search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, And replace this text"<myserver>/arcgis_js_api/library/3.0/jsapi/"
Configuration Options for compact build:
- OpenC: \ Inetpub \ wwwroot \ arcgis_js_api \ library \ 3.0 \ jsapicompact \ init. jsIn a text editor and search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, And replace each instance of this text
"<myserver>/arcgis_js_api/library/3.0/jsapicompact/"
- OpenC: \ Inetpub \ wwwroot \ arcgis_js_api \ library \ 3.0 \ jsapi \ JS \ dojo. jsIn a text editor and search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, And replace this text"<myserver>/arcgis_js_api/library/3.0/jsapicompact/"
- OpenC: \ Inetpub \ wwwroot \ arcgis_js_api \ library \ 3.0 \ jsapi \ JS \ dojo. js. uncompressed. jsIn a text editor and search for the text
'[HOSTNAME_AND_PATH_TO_JSAPI]'
, And replace this text"<myserver>/arcgis_js_api/library/3.0/jsapicompact/"
You need to configure the default document in IIS: use default. ashx for IIS, index. jsp for a Java application server (such as Tomcat), or index. php for a PHP application server
You can test http: // <myserver>/arcgis_js_api/library/3.0/jsapi/and at the following address.
http://<myserver>/arcgis_js_api/library/3.0/jsapicompact/
Next is the key step to configure the server, modify the <serverinstalldir> \ Server \ framework \ Runtime \ Tomcat \ webapps \ ArcGIS # Rest \ WEB-INF \ Classes \ resources \ rest-config.properties is as follows:
Parameter Name: jsapi. ArcGIS
Original Value: http://serverapi.arcgisonline.com/jsapi/arcgis? V = 2.6
Value to be replaced: http: // myserver/arcgis_js_api/library/3.0/jsapi
Parameter Name: jsapi.arcgis.css
Original Value: http://serverapi.arcgisonline.com/jsapi/arcgis/2.6/js/dojo/dijit/themes/tundra/tundra.css
Value to be replaced: http: // myserver/arcgis_js_api/library/3.0/jsapi/JS/dojo/dijit/themes/Tundra/tundra.css
After the configuration is complete, restart the server. The final effect is as follows: