ArcGIS API for JavaScript configuration

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.