美文网首页
arcgis api for js 4.13离线部署

arcgis api for js 4.13离线部署

作者: MaJiT | 来源:发表于2019-11-12 14:16 被阅读0次

    1.打开IIS管理器,在中间部分找到HTTP响应标头,如下图。

    image.png

    2.添加如下图所示的三个响应标头。

    image.png
    Access-Control-Allow-Headers       Content-Type, api_key, Authorization, X-Requested-With
    Access-Control-Allow-Origin        *
    Access-Control-Allow-Methods       GET,POST,PUT,DELETE,OPTIONS
    

    3.解压下载好的arcgis API for js

    image.png

    4.IIS服务器添加网站路径定位到解压好的目录

    image.png

    5.更改本地部署路径:init.js 和 dojo.js 文件中的路径改为“http://你的IP地址/arcgis_js_api\library\4.13\dojo”

    6.测试

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
    <title>Intro to MapView - Create a 2D map - 4.10</title>
    <style>
    html,
    body,
    #viewDiv {
    padding: 0;
    margin: 0;
    height: 100%;
    width: 100%;
    }
    </style>
    <link rel="stylesheet" href="http://localhost/arcgis_js_api/library/4.13/esri/css/main.css">
    <script src="http://localhost/arcgis_js_api/library/4.13/init.js"></script>
    <script>
    require([
    "esri/Map",
    "esri/views/MapView"
    ], function(Map, MapView) {
    var map = new Map({
    basemap: "streets"
    }); 
    var view = new MapView({
    container: "viewDiv",
    map: map,
    zoom: 4,
    center: [15, 65] // longitude, latitude
    });
    });
    </script>
    </head>
    <body>
    <div id="viewDiv"></div>
    </body>
    </html>
    

    相关文章

      网友评论

          本文标题:arcgis api for js 4.13离线部署

          本文链接:https://www.haomeiwen.com/subject/jhofictx.html