最近又重新搞起arcgis javascript开发,配置环境时总结了下原来的问题:

以前在webstorm中添加一个API,用来平时在webstorm中调试,然后在自己电脑iis中再配置一个API,这样调试起来比方便,但是最终布置环境时还得再将web storm中的api路径指向iis,有点烦,所以就干脆直接把webstorm项目放到iis里面了,这样就不用两个api包了,调试起来也比较方便==

下面介绍一下基本步骤:

1、首先去官网下载javascript API,前提要有arcgis账号奥==

当然你也可以把sdk下载下来,不过打开后基本打不开,可能是因为没有放在服务器上的原因,自己没试,跟官网上帮助差不多。

2、拷贝api到服务器下

这里有两个版本,一个是normal版,一个是compact版,大小差的不是很多,一般用normal版就可以。

找到api拷贝到服务器后,将3.18\init.js文件中的[HOSTNAME_AND_PATH_TO_JSAPI]修改为自己的服务器路径,如192.168.0.22:88;

同理,将3.18\dojo\dojo.js文件中的[HOSTNAME_AND_PATH_TO_JSAPI]修改为自己的服务器路径,如192.168.0.22:88。

3、arcgis javascript本地环境测试

这下就将arcgis javascript本地环境配置好了可以用下面的html测试一下。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Simple Map</title><link rel="stylesheet" type="text/css" href="http://<myserver>/arcgis_js_api/library/3.18/3.18/dijit/themes/tundra/tundra.css"/><link rel="stylesheet" type="text/css" href="http://<myserver>/arcgis_js_api/library/3.18/3.18/esri/css/esri.css" /><script type="text/javascript" src="http://<myserver>/arcgis_js_api/library/3.18/3.18/init.js"></script><script type="text/javascript">dojo.require("esri.map");function init() {var myMap = new esri.Map("mapDiv");//note that if you do not have public Internet access then you will need to point this url to your own locally accessible cached service.var myTiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer");myMap.addLayer(myTiledMapServiceLayer);}dojo.addOnLoad(init);</script></head><body class="tundra"><div id="mapDiv" style="width:900px; height:600px; border:1px solid #000;"></div></body>
</html>

下面将原文英文附加如下:

Installing the ArcGIS API for JavaScript Library on Windows

The instructions below assume that you are installing the ArcGIS JavaScript API library in the following location on an IIS Web Server, "http://<myserver>/arcgis_js_api/library/3.18/" where <myserver> is the domain name of your Web site. After copying files to your Web server, you will need to edit some files to include the URL to the server and directory that you are planning to install to.

For instructions on deploying the library on Linux/Unix, please go to the installation notes for Linux/Unix.

  1. Copy \arcgis_js_api\library and all its contents from the zip file to your Web server. In this example the files are copied to:
    C:\Inetpub\wwwroot\arcgis_js_api\library

Install the Normal or Compact Build

ArcGIS JSAPI 3.18 contains two builds--a normal build and a compact build. The compact build removes the Dojo Dijit dependancy and minimizes the non-essential ArcGIS JSAPI classes. Please see the documentation for more details.

Your directions may differ depending on your server configuration or Web server, but the process is the same.

Configuration options for normal build:

  1. Open C:\Inetpub\wwwroot\arcgis_js_api\library\3.18\3.18\init.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.18/3.18/"
  2. Open C:\Inetpub\wwwroot\arcgis_js_api\library\3.18\3.18\dojo\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.18/3.18/"

Configuration options for compact build:

  1. Open C:\Inetpub\wwwroot\arcgis_js_api\library\3.18\3.18compact\init.js in a text editor and search for the text '[HOSTNAME_AND_PATH_TO_JSAPI]', and replace each instance of this text with "<myserver>/arcgis_js_api/library/3.18/3.18compact/"
  2. Open C:\Inetpub\wwwroot\arcgis_js_api\library\3.18\3.18compact\dojo\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.18/3.18compact/"

Using HTTP/HTTPS with different ports

The steps below outline what to do if accessing non-default (80/443) HTTP/HTTPS ports in a single local API install.

Assuming init.js is accessible at the following URL: http://xyz.company.com/jsapi/init.js and the web server uses a non-standard port for HTTPS, the baseUrl value below would work:

  1. baseUrl: (location.protocol === "file:" ? "http:" : location.protocol)
    + "//" + "xyz.company.com:" + (location.protocol === "https:" ? 8443 : 9090) + "/jsapi/dojo"

    Assume that HTTP port = 9090 and HTTPS port = 8443. Replace

    "[HOSTNAME_AND_PATH_TO_JSAPI]/dojo"

    with

    "xyz.company.com:" + (location.protocol === "https:" ? "8443" : "9090") + "/jsapi/dojo"

    If the HTTP port is standard 80, but HTTPS port is non-standard.

  2. "xyz.company.com:" + (location.protocol === "https:" ? "8443" : "") + "/jsapi/dojo"

Test the Install

Now you should be able to access the ArcGIS JavaScript library from your Web server using the following URL(s):

    http://<myserver>/arcgis_js_api/library/3.18/3.18/init.jshttp://<myserver>/arcgis_js_api/library/3.18/3.18compact/init.js

Test your install. You can use the following test code to validate your JSAPI library install.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Simple Map</title><link rel="stylesheet" type="text/css" href="http://<myserver>/arcgis_js_api/library/3.18/3.18/dijit/themes/tundra/tundra.css"/><link rel="stylesheet" type="text/css" href="http://<myserver>/arcgis_js_api/library/3.18/3.18/esri/css/esri.css" /><script type="text/javascript" src="http://<myserver>/arcgis_js_api/library/3.18/3.18/init.js"></script><script type="text/javascript">dojo.require("esri.map");function init() {var myMap = new esri.Map("mapDiv");//note that if you do not have public Internet access then you will need to point this url to your own locally accessible cached service.var myTiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer");myMap.addLayer(myTiledMapServiceLayer);}dojo.addOnLoad(init);</script></head><body class="tundra"><div id="mapDiv" style="width:900px; height:600px; border:1px solid #000;"></div></body>
</html>

Change the ArcGIS Services Directory "View In JavaScript" URL

The Services Directory allows you to view Map and Image services using the JavaScript API. Set the following values in the rest-config.properties file to use the local install:

#JS API URLs
jsapi.arcgis=http://<myserver>/arcgis_js_api/library/3.18/3.18/
jsapi.arcgis.sdk=http://<myserver>/arcgis_js_sdk/sdk/
jsapi.arcgis.css=http://<myserver>/arcgis_js_api/library/3.18/3.18/dijit/themes/tundra/tundra.css

Finally make sure the import statement for the esri.css stylesheet is in the <ArcGIS Server Install Location>ArcGIS\Server\framework\runtime\tomcat\webapps\arcgis#rest\www\client\mapserver\mapserverJSAPI.jsp file.

<style>
@import "<%=jsapiArcgisCssUrl%>";
@import "<%=cpath%>/static/jsapi.css";
@import "<%=jsapiArcgisUrl%>/js/esri/css/esri.css";
</style>

Arcgis Javascript那些事儿(六)--arcgis js API本地环境配置相关推荐

  1. 基于node.js开发环境下创建及开发vue.js项目的环境配置骤

    基于node.js开发环境下创建开发vue.js项目的环境配置骤如下: 步骤一:安装node.js,安装完后运行node -v命令检安装node的查版本,判断是否安装成功.Npm是node.js包管理 ...

  2. Node.js安装及环境配置之Windows-npm instal xxx -g 提示没有权限

    前端环境安装 问题: 电脑恢复出厂设置了,重新安装node并配置环境变量后,无法全局安装使用,提示没有权限. 安装下面安装 Node.js安装及环境配置之Windows篇 报错:没有权限 The op ...

  3. 大疆上云API本地部署配置

    大疆上云API本地部署配置 前提条件 1.在大疆平台注册账号后新建APP后获取到的信息 SDK TypeCloud API APP Name: xxxxx APP ID : xxxxx App Key ...

  4. Arcgis javascript那些事儿(二十)——dojo中djconfig配置、dojo与requirejs项目冲突

    一.引言 由于项目一部分使用requirejs另一部分地图是用dojo开发(因为arcgis javascript使用的dojo),两个要和到一起,所以要求研究下如何把两者和到一起,花了两天时间看了看 ...

  5. Arcgis Javascript那些事儿(十一)--网络分析服务使用

    上一篇文章写了如何使用arcmap发布网络分析服务,发布的最后就是使用,下面就讲讲网络分析服务在arcgis javascript中的使用. 网络分析服务包括:最优路径分析,最近设施点分析,服务区分析 ...

  6. Arcgis Javascript那些事儿(七)--AMD详解

    讲解arcgis中的amd知识前,首先介绍这两种Javascript模块规范:CommonJS和AMD.我主要介绍AMD,但是要先从CommonJS讲起. CommonJS 2009年,美国程序员Ry ...

  7. Arcgis Javascript那些事儿(九)--自定义infowindow

    从开始使用js API,就一直使用infowindow,最近需要自定义的时候才发现里面问题和方法还挺多的,没有android端这么清晰,最近看了些博文和官网,自己总结了方法如下: 一.继承infowi ...

  8. Arcgis Javascript那些事儿(三)---arcgis sever服务器注册关于数据拷贝问题

    1.如何将数据库注册到ARCSERVER服务器 前置知识:在10.1中,服务器端为了确保发布的服务能访问到所需的数据,采取了如下两种措施:1)如果数据注册到了服务器,则服务器会从注册的数据中找到位置列 ...

  9. Arcgis Javascript那些事儿(一)--Arcgis server发布feature access服务

    1.什么是要素服务? 要素服务可用来通过 Internet 提供要素,并提供显示要素时所要使用的符号系统.之后,客户端可执行查询操作以获取要素,并执行相应的编辑操作.要素服务提供了可用于提高客户端编辑 ...

最新文章

  1. html input type=file 文件上传; 图片上传; 图片闪烁
  2. 基于OIDC(OpenID Connect)的SSO(纯JS客户端)
  3. Bootstrap3 带列表组的面板
  4. (4)ZYNQ AXI4总线协议介绍
  5. 你扔掉的旧衣服撑起了一个千亿市场?
  6. Java JDBC初步
  7. tomcat启动时,没有启动你所配置的项目(原因可能是Eclipse 中的工程builed 失败造成),如何解决~
  8. java形参、实参、值传递、引用传递
  9. C中取得数组的地址,赋值给数组结构的字段
  10. NGN学习笔记8——NGN的安全问题
  11. 菜鸟驿站进军万亿社区市场
  12. 夜神模拟器99%卡死打不开问题
  13. bem css_CSS体系结构:块元素修饰符(BEM)和原子CSS
  14. 创建API Signing Key
  15. Word embeddings-词向量
  16. ssh登录提示RSA Host key认证失败的解决方法
  17. 数据的加载 - 清洗处理 - 分组分类 - 存储
  18. 有源医疗器械的开发过程和各阶段的注意事项(九)——————设计验证阶段
  19. ESP32-硬件SPI读取MCP3208
  20. Flow公链 |FCL1.0正式上线

热门文章

  1. 服务器导流板的作用,前保险杠下导流板的作用是什么?
  2. linq的字段自增长属性设置_云途晨报9月9日前,这5类ebay物品属性必须完成更新;Wish体积重计算方式即将更新...
  3. 洛谷——P1876 开灯
  4. CSS3过渡效果(CSS3)
  5. 天梯—个位数统计(C语言)
  6. html2canvas在iphone7 iphonex都生成不了
  7. mpvue 微信小程序设置背景音乐
  8. ubuntu之修改登陆密码
  9. Open3d之表面重建
  10. gps频率范围_如何计量检定频率计数器