ArcGIS Server for javascript API installation and deployment
ESRI has released the latest ArcGIS Server for javascript API v3.2, which provides richer and more powerful functions. Next we will download and deploy the ArcGIS Server for javascript API.
The official website of ArcGIS Server for javascript API is
Http://help.arcgis.com/en/webapi/javascript/arcgis/
The API is
Http://www.esri.com/apps/products/download/index.cfm? Fuseaction = download. All # arcgis_api_for_javascript
Download ArcGIS API for JavaScript v 3.2.
And ArcGIS API for JavaScript v 3.2 SDK
You can apply for one global ESRI user;
After the download is complete, as shown in figure
Decompress the two packages respectively.
Next, deploy the API and SDK locally. Take IIS as an example and deploy it to c: \ Inetpub \ wwwroot. Copy the arcgis_js_v32_sdk folder to c: \ Inetpub \ wwwroot and change it to C: \ Inetpub \ wwwroot \ arcgis_js_v32_sdk; place the library folder under arcgis_js_v32_api \ arcgis_js_api to c: \ Inetpub \ wwwroot \ Users \ arcgis_js_api and change it to C: \ Inetpub \ wwwroot \ arcgis_js_v32_sdk \ arcgis_js_api \ Library; then input http: // localhost/arcgis_js_v32_sdk/install.htm in IE;
Click ArcGIS API for JavaScript.
Initial deployment successful;
Next, you need to modify the configuration file so that the corresponding reference function location can be found when called by other programs.
1. Find c: \ Inetpub \ wwwroot \ arcgis_js_v32_sdk \ arcgis_js_api \ library \ 3.2 \ jsapi \ init. open the JS file. Open it through editplus. Find '[hostname_and_path_to_jsapi]' and replace it with "<myserver>/
Arcgis_js_v32_sdk/arcgis_js_api/library/3.2/jsapi/"; where <myserver> is the machine name or machine IP address without the HTTP prefix;
2. Find the c: \ Inetpub \ wwwroot \ arcgis_js_v32_sdk \ arcgis_js_api \ library \ 3.2 \ jsapi \ JS \ dojo. js file, open it through editplus, and find'[HOSTNAME_AND_PATH_TO_JSAPI]'
, Replace
"
<Myserver>/
Arcgis_js_v32_sdk/arcgis_js_api/libraries/3.2/jsapi/"
Where
<Myserver> is the machine name or machine IP address without an HTTP prefix;
3. Find c: \ Inetpub \ wwwroot \ arcgis_js_v32_sdk \ arcgis_js_api \ library \ 3.2 \ jsapicompact \ init. open the JS file. Open it through editplus. Find '[hostname_and_path_to_jsapi]' and replace it with "<myserver>/
Arcgis_js_v32_sdk/arcgis_js_api/library/3.2/jsapicompact/"; <myserver> indicates the machine name or IP address without the HTTP prefix;
4. Find c: \ Inetpub \ wwwroot \ arcgis_js_v32_sdk \ arcgis_js_api \ library \ 3.2 \ jsapicompact \ JS \ dojo. open the JS file. Open it through editplus. Find '[hostname_and_path_to_jsapi]' and replace it with "<myserver>/
Arcgis_js_v32_sdk/arcgis_js_api/library/3.2/jsapicompact/"; <myserver> indicates the machine name or IP address without the HTTP prefix;
The above completes the local deployment of ArcGIS srever for javascript API; test it through a simple instance;
Create an empty HTML page in editplus and copy the following code.
<! Doctype HTML public "-// W3C // dtd html 4.01 // en" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> simple Map </title>
<LINK rel = "stylesheet" type = "text/CSS" href = "http: // <myserver>/arcgis_js_v32_sdk/arcgis_js_api/library/3.2/jsapi/JS/dojo/dijit/themes/Tundra/tundra.css "/>
<LINK rel = "stylesheet" type = "text/CSS" href = "http: // <myserver>/arcgis_js_v32_sdk/arcgis_js_api/library/3.2/jsapi/JS/ESRI/CSS/esri.css "/>
<SCRIPT type = "text/JavaScript" src = "http: // <myserver>/arcgis_js_v32_sdk/arcgis_js_api/library/3.2/jsapi/init. js"> </SCRIPT>
<SCRIPT type = "text/JavaScript">
Dojo. Require ("ESRI. Map ");
Function Init (){
VaR mymap = new ESRI. Map ("mapdiv ");
// Note that if you do not have public Internet access then you will need to point this URL to your own locally accessible cached service.
VaR mytiledmapservicelayer = new ESRI. layers. arcgistiledmapservicelayer ("http://server.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer ");
Mymap. addlayer (mytiledmapservicelayer );
}
Dojo. addonload (init );
</SCRIPT>
</Head>
<Body class = "tundra">
<Div id = "mapdiv" style = "width: 900px; Height: 600px; Border: 1px solid #000;"> </div>
</Body>
</Html>
Replace <myserver> with your machine name or IP address.
It indicates that a local ArcGIS Server for javascript API has been deployed, and other programs can call the function.
The ArcGIS Server for javascript API uses a large number of dojo technologies. We recommend that you learn the dojo technology.