ArcGIS server10.1 local deployment of javascript API

Source: Internet
Author: User

When using the server, you may find that you can browse the map in Javascript mode in the rest address. You need to compute the map and use it in the case of Internet connection. The reason is that you have called the online javascript API, next, let's look at how to make the server use the local API.

First download js api: http://www.esri.com/apps/products/download/index.cfm? Fuseaction = download. All # arcgis_api_for_javascript. The installation and installation documentation must complete API configuration.

Copy\arcgis_js_api\libraryAnd all its contents from the DVD to your web server. In this example the files are copied

C:\Inetpub\wwwroot\arcgis_js_api\library

 

Configuration Options for normal build:

  1. OpenC: \ Inetpub \ wwwroot \ arcgis_js_api \ library \ 3.0 \ jsapi \ init. jsIn a text editor and search for the text
    '[HOSTNAME_AND_PATH_TO_JSAPI]', And replace this text"<myserver>/arcgis_js_api/library/3.0/jsapi/"
  2. OpenC: \ Inetpub \ wwwroot \ arcgis_js_api \ library \ 3.0 \ jsapi \ JS \ dojo. jsIn a text editor and search for the text
    '[HOSTNAME_AND_PATH_TO_JSAPI]', And replace this text"<myserver>/arcgis_js_api/library/3.0/jsapi/"
  3. OpenC: \ Inetpub \ wwwroot \ arcgis_js_api \ library \ 3.0 \ jsapi \ JS \ dojo. js. uncompressed. jsIn a text editor and search for the text
    '[HOSTNAME_AND_PATH_TO_JSAPI]', And replace this text"<myserver>/arcgis_js_api/library/3.0/jsapi/"

Configuration Options for compact build:

  1. OpenC: \ Inetpub \ wwwroot \ arcgis_js_api \ library \ 3.0 \ jsapicompact \ init. jsIn a text editor and search for the text
    '[HOSTNAME_AND_PATH_TO_JSAPI]', And replace each instance of this text
    "<myserver>/arcgis_js_api/library/3.0/jsapicompact/"
  2. OpenC: \ Inetpub \ wwwroot \ arcgis_js_api \ library \ 3.0 \ jsapi \ JS \ dojo. jsIn a text editor and search for the text
    '[HOSTNAME_AND_PATH_TO_JSAPI]', And replace this text"<myserver>/arcgis_js_api/library/3.0/jsapicompact/"
  3. OpenC: \ Inetpub \ wwwroot \ arcgis_js_api \ library \ 3.0 \ jsapi \ JS \ dojo. js. uncompressed. jsIn a text editor and search for the text
    '[HOSTNAME_AND_PATH_TO_JSAPI]', And replace this text"<myserver>/arcgis_js_api/library/3.0/jsapicompact/"

You need to configure the default document in IIS: use default. ashx for IIS, index. jsp for a Java application server (such as Tomcat), or index. php for a PHP application server

You can test http: // <myserver>/arcgis_js_api/library/3.0/jsapi/and at the following address.
http://<myserver>/arcgis_js_api/library/3.0/jsapicompact/

Next is the key step to configure the server, modify the <serverinstalldir> \ Server \ framework \ Runtime \ Tomcat \ webapps \ ArcGIS # Rest \ WEB-INF \ Classes \ resources \ rest-config.properties is as follows:

   

Parameter Name: jsapi. ArcGIS
Original Value: http://serverapi.arcgisonline.com/jsapi/arcgis? V = 2.6
Value to be replaced: http: // myserver/arcgis_js_api/library/3.0/jsapi

Parameter Name: jsapi.arcgis.css
Original Value: http://serverapi.arcgisonline.com/jsapi/arcgis/2.6/js/dojo/dijit/themes/tundra/tundra.css
Value to be replaced: http: // myserver/arcgis_js_api/library/3.0/jsapi/JS/dojo/dijit/themes/Tundra/tundra.css

After the configuration is complete, restart the server. The final effect is as follows:

 

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.