Arcgis API For Javascript下载与安装

本文以3.9版本为示例


1.最新API下载地址:http://support.esrichina-bj.cn/2011/0223/960.html

2.解压缩包:arcgis_js_v39_api.zip

3.复制解压出来的Library到C:\Inetpub\wwwroot\arcgis_js_api\library(arcgis_js_api文件夹若没有自己创建)

4.打开 C:\Inetpub\wwwroot\arcgis_js_api\library\3.9\3.9\init.js 替换[HOSTNAME_AND_PATH_TO_JSAPI] 为 "<myserver>/arcgis_js_api/library/3.9/3.9/"

5.打开C:\Inetpub\wwwroot\arcgis_js_api\library\3.9\3.9\js\dojo\dojo\dojo.js替换[HOSTNAME_AND_PATH_TO_JSAPI]为 "<myserver>/arcgis_js_api/library/3.9/3.9/"


6.测试网页

<!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.9/3.9/js/dojo/dijit/themes/tundra/tundra.css"/>
    <link rel="stylesheet" type="text/css" href="http://<myserver>/arcgis_js_api/library/3.9/3.9/js/esri/css/esri.css" />
    <script type="text/javascript" src="http://<myserver>/arcgis_js_api/library/3.9/3.9/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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值