(Original post address http://www.th7.cn/Program/net/2011/12/22/51908.shtml)
1. First download the latest API: arcgis_js_v26_api.zip and SDK: arcgis_js_v26_sdk.zip on the official website ArcGIS API for JavaScript download page (account required;
2. decompress the downloaded unzip and arcgis_js_v26_sdk.zip files respectively, and copy the arcgis_js_api folder in the respective folders to C:/inetpub/wwwroot, because the copied folders are named arcgis_js_api, therefore, when copying the second folder, select overwrite;
3. Copy the esri. js file under C:/inetpub/wwwroot/arcgis_js_api/library/2.6/jsapi/js/esri.
C:/inetpub/wwwroot/arcgis_js_api/library/2.6/jsapi/js/dojo/two files under dojo. xd. js and dojo. xd. js. uncompressed. js
Replace [HOSTNAME_AND_PATH_TO_JSAPI] With djConfig. url + "/arcgis_js_api/library/2.6/jsapi/(note that there is no colon missing). Similarly
C:/inetpub/wwwroot/arcgis_js_api/library/2.6/esri. js file under jsapicompact/js/esri
C:/inetpub/wwwroot/arcgis_js_api/library/2.6/jsapicompact/js/dojo/two files under dojo. xd. js and dojo. xd. js. uncompressed. js
Replace [HOSTNAME_AND_PATH_TO_JSAPI] With djConfig. url + "/arcgis_js_api/library/2.6/jsapicompact/(note the colon );
4. in IIS, convert arcgis_js_api to an application, and add: default. ashx in the default document;
5. var djConfig = {parseOnLoad: true, url: "localhost"}; add a url attribute. The url is the IP address of the server where the api is located.
Will http://serverapi.arcgisonline.com/jsapi/arcgis? Replace v = 2.6 With http: // localhost/arcgis_js_api/library/2.6/jsapi localhost. Replace it with the IP address of the server where the api is located.
Replace http://serverapi.arcgisonline.com/jsapi/arcgis/2.6/js/dojo/dijit/themes/claro/claro.css
Http: // localhost/arcgis_js_api/library/2.6/jsapi/js/dojo/dijit/themes/claro/claro.css localhost should be changed to the IP address of the server where the api is located;