本人接触arcgis不久,现就arcgis 基于tomcat搭建离线argis for js API进行描述,以帮助搭建java工程的朋友。
一、下载离线JS API,本人下载的是arcgis_js_v34_api.zip 可在:http://support.esrichina.com.cn/2011/0223/960.html进行下载 Library | SDK new
二、下载eclispe for javaee ,并打开eclipse for jee创建web工程(本节基于会javaee开发的人员,不会的可以去找相关javaee开发资料),工程名为arcgis
三、将下载下来的api解压,并将arcgis_js_api文件copy到webContent(或WebRoot)目录下. 如图:[img][/img]请看附件
四、然后照着解压目录下有一个install.htm页面里的配置进行修改。 Configuration options for normal build: 1
、
Open
C:\\Inetpub\\wwwroot\\arcgis_js_api\\library\\3.4\\3.4\\init.js in a
text
editor
and
search
for
the
text
'[HOSTNAME_AND_PATH_TO_JSAPI]', and replace this text with \
2、Open
C:\\Inetpub\\wwwroot\\arcgis_js_api\\library\\3.4\\3.4\\js\\dojo\\dojo\\dojo.js in a text editor and search for the text '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace this text with \Configuration options for compact build: 3
、
Open
C:\\Inetpub\\wwwroot\\arcgis_js_api\\library\\3.4\\3.4compact\\init.js in a text editor and search for the text '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace each instance of this
text
with
\4
、
Open
C:\\Inetpub\\wwwroot\\arcgis_js_api\\library\\3.4\\3.4compact\\js\\dojo\\dojo\\dojo.js in a text editor and search for the text '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace this text with \
基于tomcat的修改对应: 1、打开刚才
copy
的文件目录:工程
(arcgis)/arcgis_js_api/library/3.4/3.4/init.js 将[HOSTNAME_AND_PATH_TO_JSAPI]修改为(包括中括号)
localhost:8080/arcgis/arcgis_js_api/library/3.4/3.4/init.js 后面3个修改的按上进行修改,
修改完成,然后启动tomcat发布出来就可以访问了 页面的请求离线jsapi例子:
HTML
PUBLIC
\
HTML
4.01//EN\
\
http-equiv=\
content=\
charset=utf-8\
rel=\
type=\
href=\4/3.4/js/dojo/dijit/themes/tundra/tundra.css\
rel=\
type=\
href=\4/3.4/js/esri/css/esri.css\
alt=\
src=\
width=\
height=\