Giter Club home page Giter Club logo

arcgis-vue's Introduction

vue-arcgis

注:当前项目由于包含了API,体积较大,因此,在码云上也同步更新,国内用户可以优先使用码云的. 地址;

总体思路就是 : 先加载 modules,然后 new 出 modules 的实例,配置相关参数即可.

代码中加载模块的来源是 'http://jsapi.thinkgis.cn/;国内访问 arcgis 官网快很多.API 地址是这个;目前的版本貌似是 3.12; 参考本地部署的;

  • 关于windows 本地部署API:

    • 1 首先下载API 压缩包:下载地址;账号注册不了,我是用谷歌账户登录的,需要科学上网才行;
    • 2 版本选择: 我下载的是3.24版本的; 4.7 版本的使用vue 加载天地图的时候会报错.一直没找到解决办法,所以尝试了 3.24 的版本;
    • 3 本地服务 : tomcat;下载好tomcat之后,删除webapps下面的所有文件;
    • 解压下载好的zip文件;一次打开目录 ~/arcgis_js_v324_api\arcgis_js_api\library\3.24\3.24,把所有的文件复制到~tomcat/webapps/arcgis目录下;
    • 4 修改 init.jsdojo.js.修改方式参考 API 压缩包中的 install_api_windows.html 如果是按照上面的操作,修改后是这样的baseUrl:"http://localhost:8080/arcgis/dojo";
    • 5 启动 tomcat,浏览器地址栏输入 http://localhost:8080/arcgis/init.js能够正常显示,则说明正常.
  • 关于本地 API :

  • 1 将arcgis API js 放到了 static 目录下,这样做的好处是在不用启动tomcat;直接可以进行开发,坏处是,会有个警告,警告内容是 : Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience.,这句话的意思是 : 由于主线程上的同步网络请求影响用户的最终体验,所以被弃用,解决方案是,加载的时候传入async:true

    esriLoader.loadScript ({ // 加载js
        url: 'http://' + location.host + '/static/dojo/dojo.js',
        dojoConfig: {
            async: true// 异步发送网络请求
        },
    });

.有可能在网络相应的模块没加载完成的时候执行then()里面的回调,是这样理解的,具体情况有待考究.

  • 详情请看代码;每行都有注释;对 arcgis稍微有点了解就能看懂.至于后续更深入的开发,请参考arcgis API.

arcgis-vue's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.