1, to the official website download the latest version: ArcGIS API for JavaScript 3.9
2. Extract two compressed packages respectively, then put the Library folder under the Arcgis_js_v39_api\arcgis_js_v39_api\arcgis_js_api folder to Arcgis_ under the Js_v39_sdk\arcgis_js_api folder, such as:
Then deploy the arcgis_js_v39_sdk to IIS.
In the browser, enter: http://<myserver>/arcgis_js_v39_sdk/install.htm, the effect is as follows
Click the ArcGIS API for JavaScript connection to jump to the following page (error may occur because a folder called 3.9 is separated under the Library folder with the full path:/http <myserver>/arcgis_js_v39_sdk/arcgis_js_api/library/3.9/install.htm):
3, there are 4 places to modify:
1), open arcgis_js_v39_sdk\arcgis_js_api\library\3.9\3.9\init.js find '[Hostname_and_path_to_jsapi]' , modified to "<myserver>/arcgis_js_api/library/3.9/3.9/"
2), open arcgis_js_v39_sdk\arcgis_js_api\library\3.9\3.9\js\dojo\dojo\dojo.js find '[hostname_and_path_to _JSAPI]', modified to "<myserver>/arcgis_js_api/library/3.9/3.9/"
3), open arcgis_js_v39_sdk\arcgis_js_api\library\3.9\3.9compact\init.js find '[hostname_and_path_to_ JSAPI]', modified to "<myserver>/arcgis_js_api/library/3.9/3.9compact/"
4), open arcgis_js_v39_sdk\arcgis_js_api\library\3.9\3.9compact\js\dojo\dojo\dojo.js find '[HOSTNAME_AND_ PATH_TO_JSAPI]', modified to "<myserver>/arcgis_js_api/library/3.9/3.9compact/"
To this configuration has been completed.
4. Testing
You can test it with a piece of code that he comes with ( don't forget to change <myserver> to your own server address ):
<!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01//en" "HTTP://WWW.W3.ORG/TR/HTML4/STRICT.DTD"><HTML> <Head> <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"/> <title>Simple Map</title> <Linkrel= "stylesheet"type= "Text/css"href= "Http://<myserver>/arcgis_js_api/library/3.9/3.9/js/dojo/dijit/themes/tundra/tundra.css"/> <Linkrel= "stylesheet"type= "Text/css"href= "Http://<myserver>/arcgis_js_api/library/3.9/3.9/js/esri/css/esri.css" /> <Scripttype= "Text/javascript"src= "Http://<myserver>/arcgis_js_api/library/3.9/3.9/init.js"></Script> <Scripttype= "Text/javascript">Dojo.require ("Esri.map"); functioninit () {varMyMap= NewESRI. Map ("Mapdiv"); //Note that if you don't have a public Internet access and you'll need to the point this URL to your own locally accessibl e cached service. varMytiledmapservicelayer= NewEsri.layers.ArcGISTiledMapServiceLayer ("Http://server.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer"); Mymap.addlayer (Mytiledmapservicelayer); } dojo.addonload (init); </Script> </Head> <Bodyclass= "Tundra"> <DivID= "Mapdiv"style= "width:900px; height:600px; border:1px solid #000;"></Div> </Body></HTML>
The effect is as follows:
ArcGIS API for JavaScript configuration