ArcGIS API for JavaScript本地化部署

1 篇文章 0 订阅

最近公司项目要把一些项目信息在地图上显示,所以请教公司GIS同事并研究,使ArcGIS API for JavaScript能够本地化部署。

1.首先需要下载ArcGIS API for JavaScript,解压放到js文件夹;

2.修改dojo.js和init.js里面的baseurl,想用相对路径可以,都设置成/js/arcgis_js_api/library/4.5/dojo;

3.在html文件中引入css js文件,如图:


4.引入测试代码

    <script> 
        require([
            "esri/Map",
            "esri/views/SceneView",
            "dojo/domReady!"
        ], function (Map, SceneView) {
            var map = new Map({
                basemap: "streets",
                ground: "world-elevation"
            });
            var view = new SceneView({
                container: "viewDiv",     // Reference to the scene div created in step 5
                map: map,                 // Reference to the map object created before the scene
                scale: 50000000,          // Sets the initial scale to 1:50,000,000
                center: [-101.17, 21.78]  // Sets the center point of view with lon/lat
            });
        })

    </script>

5.成功结果


总结:初次接触map,研究了好久。这也是很多初次接触者必过的坎。。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值