ArcGIS Server for JavaScript Local deployment
The first time you use ArcGIS Server for JS Development, there are many shortcomings in the experience, so I will be in the development process encountered problems written to share with you. There is no shortage of places also hope to correct, learn together.
First, the ArcGIS ArcGIS for JavaScript API is: http://help.arcgis.com/en/webapi/javascript/arcgis/
Second, after the download of the compressed package after decompression
C. Deploy the extracted APIs and SDKs to the IIS Wwwroot folder:
Note that in the back of the code test in the waist type of file links, such as the folder in the question of the price is copied separately, placed in the Wwwroot folder, or error.
Four, the relevant parameters of the modification, you can also refer to the library Ask price folder below the install.html file.
Configuration options for normal build:
- Open C:\Inetpub\wwwroot\arcgis_js_api\library\3.11\3.11\init.js in a text editor
‘[HOSTNAME_AND_PATH_TO_JSAPI]‘
and search for the text, a nd Replace this text with"<myserver>/arcgis_js_api/library/3.11/3.11/"
- Open C:\Inetpub\wwwroot\arcgis_js_api\library\3.11\3.11\dojo\dojo.js in a text editor and search for the text , and replace this text with
"<myserver>/arcgis_js_api/library/3.11/3.11/"
Configuration Options for Compact build:
- Open C:\Inetpub\wwwroot\arcgis_js_api\library\3.11\3.11compact\init.js in a text editor and search for the text
‘[HOSTNAME_AND_PATH_TO_JSAPI]‘
, and replace each instance of the this text with"<myserver>/arcgis_js_api/library/3.11/3.11compact/"
- Open C:\Inetpub\wwwroot\arcgis_js_api\library\3.11\3.11compact\dojo.js in a text editor and search for the text
‘[HOSTNAME_AND_PATH_TO_JSAPI]‘
, and replace this text with"<myserver>/arcgis_js_api/library/3.11/3.11compact/"
Note: In the case of parameter substitution, the <myserver> is the hostname, which is normally changed to localhost. No, it's too much trouble in the changes!
Five, complete the above file deployment in VS after the new Web program, add HTML page, to test whether the deployment was successful.
The specific code is as follows:
1 <Head>2 <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"/>3 <title>Loading of maps</title>4 <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"/>5 <title>Simple Map</title>
Note: The code here is a local deployment call where the file path must be correct or debug error. 6 <link rel= "stylesheet" type= "Text/css" href= "http://localhost/arcgis_js_api/library/3.11/3.11/dijit/ Themes/tundra/tundra.css "/> 7 <link rel=" stylesheet "type=" Text/css "href=" http://localhost/arcgis_js_api/ Library/3.11/3.11/esri/css/esri.css "/> 8 <script type=" Text/javascript "src=" http://localhost/arcgis_js_api/ Library/3.11/3.11/init.js "></script>9 <Scriptsrc= "Dojo/jsapi_vsdoc10_v33.js"type= "Text/javascript"></Script>Ten <styletype= "Text/css"> One . Mapclass{width:900px;Height:600px;Border:1px solid #000; } A </style> - <Scripttype= "Text/javascript">Dojo.require ("Esri.map"); - Dojo.addonload (function () the { - varMyMap= NewESRI. Map ("Mymapdiv"); - varMytiledmapservicelayer= NewEsri.layers.ArcGISTiledMapServiceLayer - ("Http://cache1.arcgisonline.cn/ArcGIS/rest/services/ChinaOnlineStreetWarm/MapServer"); + Mymap.addlayer (Mytiledmapservicelayer) - }) + A </Script> at </Head> - <Bodyclass= "Tundra"> - <DivID= "Mymapdiv"class= "Mapclass"> - - </Div> in </Body> - </HTML>
Vi. Display of test results
ArcGIS Server Development API for JS Local deployment