arcgis通俗易懂教程(一)------入门教程

使用arcgis的流程
(官网翻译篇(https://blog.csdn.net/A11111AsUN/article/details/107358397))

代码实例

Visualize data with dictionary renderer - 4.15
<link
  rel="stylesheet"
  href="https://js.arcgis.com/4.15/esri/themes/light/main.css"
/>
<script src="https://js.arcgis.com/4.15/"></script>

<script>
  require([
    "esri/Map",
    "esri/views/MapView",
    "esri/layers/FeatureLayer",
    "esri/renderers/DictionaryRenderer",
    "esri/widgets/Expand",
    "esri/widgets/Bookmarks",
    "esri/webmap/Bookmark"
  ], function(
    Map,
    MapView,
    FeatureLayer,
    DictionaryRenderer,
    Expand,
    Bookmarks,
    Bookmark
  ) {
    var map=new Map({
      basemap: "gray-vector"
    });

    const view = new MapView({
      container: "viewDiv",
      map: map,
      extent: {
        spatialReference: {
          wkid: 102100
        },
        xmax: -13581772,
        xmin: -13584170,
        ymax: 4436367,
        ymin: 4435053
      }
    });

    const popupTemplate = {
      // autocasts as new PopupTemplate()
      title: "station: {Station_Name}",
      content: [
        {
          // It is also possible to set the fieldInfos outside of the content
          // directly in the popupTemplate. If no fieldInfos is specifically set
          // in the content, it defaults to whatever may be set within the popupTemplate.
          type: "fields",
          fieldInfos: [
            {
              fieldName: "Fuel_Type_Code",
              label: "Fuel type"
            },
            {
              fieldName: "EV_Network",
              label: "EV network"
            },
            {
              fieldName: "EV_Connector_Types",
              label: "EV connection types"
            },
            {
              fieldName: "Station_Name",
              label: "Station Name"
            }
          ]
        }
      ]
    };

    const scale = 36112;
    const layer_1 = new FeatureLayer({
      url:
        "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Alternative_Fuel_Station_March2018/FeatureServer",
      outFields: ["*"],
      popupTemplate: popupTemplate,
      renderer: new DictionaryRenderer({
        url:
          "https://jsapi.maps.arcgis.com/sharing/rest/content/items/30cfbf36efd64ccf92136201d9e852af",
        fieldMap: {
          fuel_type: "Fuel_Type_Code"
        },
        config: {
          show_label: "false"
        },
        visualVariables: [
          {
            type: "size",
            valueExpression: "$view.scale",
            stops: [
              { value: scale / 2, size: 20 },
              { value: scale * 2, size: 15 },
              { value: scale * 4, size: 10 },
              { value: scale * 8, size: 5 },
              { value: scale * 16, size: 2 },
              { value: scale * 32, size: 1 }
            ]
          }
        ]
      }),
      minScale: 0,
      maxScale: 10000
    });

    const layer_2 = new FeatureLayer({
      url:
        "https://services1.arcgis.com/4yjifSiIG17X0gW4/arcgis/rest/services/Alternative_Fuel_Station_March2018/FeatureServer",
      outFields: ["*"],
      popupTemplate: popupTemplate,
      renderer: new DictionaryRenderer({
        url:
          "https://jsapi.maps.arcgis.com/sharing/rest/content/items/30cfbf36efd64ccf92136201d9e852af",
        fieldMap: {
          fuel_type: "Fuel_Type_Code",
          connector_types: "EV_Connector_Types",
          network: "EV_Network",
          name: "Station_Name"
        },
        config: {
          show_label: "false"
        }
      }),
      minScale: 10000,
      maxScale: 0
    });

    map.addMany([layer_1, layer_2]);

   

    
  });
</script>

步骤解释

1、引入arcgis的js和css文件
2、创建一个组件,给该组件定义一个id
3、在js文件中,创建MapView(2D)或者ScreenView(3D)。在view中定义id组件为地图视图的容器
4、定义一个地图组件(new Map())。在地图组件中引入基本图层
5、创建渲染图层,将渲染图层添加到地图中。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
第一章 欢迎使用ArcGIS 5 用ArcGIS 能干什么? 6 日常事务中各具特色的GIS项目 9 ArcGIS能完成的任务 11 学习ArcGIS的技巧 16 第二章 浏览ArcCatalog 和ArcMap ArcCatalog 简介 18 在ArcCatalog 中浏览数据 19 与数据建立连接 20 ArcMap 简介 24 操作地图 25 浏览地图 26 添加图层 29 添加要素 30 改变图层符号 31 添加标注 34 对地图进行排版 36 保存地图 42 打印地图 43 下一步做什么? 44 第三章 浏览GIS 数据 45 地理数据模型 46 要素数据格式 50 第四章 设计GIS 项目 65 什么是GIS 分析? 66 GIS 项目开发步骤 69 设计项目 71 第五章 组织数据库 77 组织项目数据库 78 将数据添加到Project 文件夹 83 在ArcCatalog 中预览数据 88 在ArcMap 中查看数据 93 清理Catalog 目录树 106 第六章 为分析准备数据 109 数据准备工作 110 什么是坐标系统? 111 为高程数据定义坐标系统 113 准备脚本环境 121 为river shape文件设置投影 122 把river shape文件输出到地理数据库中 128 数字化古迹公园 130 合并地块层 150 第七章 数据分析 157 分析前的设置 158 勾画允许建厂的区域 159 勾画不允许建厂的区域 163 查找符合位置标准的地块 179 查找空的地块 183 查找道路附近和废水汇合处附近的地块 186 查找满足所需面积标准的地块 196 评估分析结果 200 第八章 展示分析成果 207 设计地图 208 设置地图页面 210 创建全景地图 218 创建适宜地块地图 224 创建最适宜地块地图 230 生成地块报告 242 添加选址标准列表 245 添加地图元素 246 保存并打印地图 260 下一步做什么? 262

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

阳光程序员

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值