ArcGIS javascript API local deployment of offline Development Environment

Source: Internet
Author: User
1. Obtain ArcGIS javascript API

APIS.

 

2 Local deployment API

Open the arcgis_js_api/library/install.htm installation instructions in the API package. This article is based on the instructions in English.

Decompress the package and create an application in IIS, for example. After the API application is configured, its path is http: // 192.168.1.58/arcgis_js_api

ArcGIS JavaScript APIs include the common and simplified versions. The simplified version removes the dependency and non-essential ArcGIS jsapi classes of dojo digit.

Configure the common version:

Open arcgis_js_api \ library \ 3.2 \ jsapi \ init. js and replace [hostname_and_path_to_jsapi] With the deployment path of the API on the local machine. Here is 192.168.1.58/arcgis_js_api/library/3.2/jsapi/. Note that the path does not need to contain http ://.

Open c: \ arcgis_js_api \ library \ 3.2 \ jsapi \ JS \ dojo. js and replace [hostname_and_path_to_jsapi] With the deployment path of the API on the local machine. Here is 192.168.1.58/arcgis_js_api/library/3.2/jsapi/. Note that the path does not need to contain http ://.

 

Configure the simplified version (if you do not use the simplified version for development, you do not need to configure it ):

Open c: \ arcgis_js_api \ library \ 3.2 \ jsapicompact \ init. js and replace [hostname_and_path_to_jsapi] With the deployment path of the API on the local machine. Here is 192.168.1.58/arcgis_js_api/library/3.2/jsapicompact/. Note that the path does not need to contain http ://.

Open c: \ arcgis_js_api \ library \ 3.2 \ jsapicompact \ JS \ dojo. js in a text editor and replace [hostname_and_path_to_jsapi] With the deployment path of the API on the local machine. Here is 192.168.1.58/arcgis_js_api/library/3.2/jsapicompact/. Note that the path does not need to contain http ://.

 

So far, the development library has been configured. The following describes how to configure ArcGIS JavaScript browsing.

 

 

Configure ArcGIS JavaScript Browser

 

According to the installation instructions, open the desktop installation directory \ ArcGIS \ Taobao kit10.1 \ HELP \ rest \ index.html and find the section "installing the rest API". For more information, see the instructions, find the rest-config.properties file in the ArcGIS Server installation directory, open the modify js api URLs, its original value is:

 

jsapi.arcgis=http://serverapi.arcgisonline.com/jsapi/arcgis?v=2.6jsapi.arcgis.sdk=http://resources.esri.com/arcgisserver/apis/javascript/arcgisjsapi.arcgis.css=http://serverapi.arcgisonline.com/jsapi/arcgis/2.6/js/dojo/dijit/themes/tundra/tundra.css

 

Change the address of arcgisand arcgis.css to the API address we configured. The modified value is:

Jsapi. ArcGIS = http: // 192.168.1.58/arcgis_js_api/library/3.2/jsapi/ArcGIS /? V = 2.6
Jsapi. ArcGIS. SDK = http://help.arcgis.com/en/webapi/javascript/arcgis/
Jsapi.arcgis.css = http: // 192.168.1.58/arcgis_js_api/library/3.2/jsapi/ArcGIS/2.6/JS/dojo/dijit/themes/Tundra/tundra.css

After the modification, visit the sample map service http: // localhost: 6080/ArcGIS/rest/services/sampleworldcities/mapserver and click "ArcGIS JavaScript" to browse the sample map in the browser.

 

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.