arcgis api for javascript如何读取要素,通过ajax请求得到的。

比如:

https://gis118.arcgisonline.cn/arcgis/sharing/rest/content/items/f08f5c59cd89420abf7e585eaa260ddd/data

可以得到FeatureLayer要素服务,这里只需要配置好f08f5c59cd89420abf7e585eaa260ddd,即itemid,就可以得到operationalLayers,得到的是一个数组,然后根据类型匹配。

{"operationalLayers":[{"id":"15d1ac59ea4-layer-0","opacity":1,"title":"Aggregation of bigDataFileShares xin3 csv by hexagon bins - Aggregation of bigDataFileShares xin3 csv by hexagon bins","url":"https://gis118.arcgisonline.cn/arcgis/rest/services/Hosted/Aggregation_of_bigDataFileShares_xin3_csv_by_hexagon_bins/FeatureServer/0","visibility":true,"layerType":"ArcGISFeatureLayer","itemId":"62be1d8c97c4461383ea4ec738e96c5c","popupInfo":{"fieldInfos":[{"fieldName":"COUNT","label":"COUNT","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"COUNT_MmeUeS1apId","label":"COUNT_MmeUeS1apId","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"SUM_MmeUeS1apId","label":"SUM_MmeUeS1apId","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"MIN_MmeUeS1apId","label":"MIN_MmeUeS1apId","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"MAX_MmeUeS1apId","label":"MAX_MmeUeS1apId","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"MEAN_MmeUeS1apId","label":"MEAN_MmeUeS1apId","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"RANGE_MmeUeS1apId","label":"RANGE_MmeUeS1apId","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"SD_MmeUeS1apId","label":"SD_MmeUeS1apId","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"VAR_MmeUeS1apId","label":"VAR_MmeUeS1apId","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"COUNT_Lat","label":"COUNT_Lat","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"SUM_Lat","label":"SUM_Lat","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"MIN_Lat","label":"MIN_Lat","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"MAX_Lat","label":"MAX_Lat","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"MEAN_Lat","label":"MEAN_Lat","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"RANGE_Lat","label":"RANGE_Lat","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"SD_Lat","label":"SD_Lat","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"VAR_Lat","label":"VAR_Lat","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"COUNT_Lon","label":"COUNT_Lon","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"SUM_Lon","label":"SUM_Lon","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"MIN_Lon","label":"MIN_Lon","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"MAX_Lon","label":"MAX_Lon","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"MEAN_Lon","label":"MEAN_Lon","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"RANGE_Lon","label":"RANGE_Lon","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"SD_Lon","label":"SD_Lon","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"VAR_Lon","label":"VAR_Lon","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"COUNT_Time","label":"COUNT_Time","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"ANY_Time","label":"ANY_Time","visible":true},{"fieldName":"COUNT_UUID","label":"COUNT_UUID","visible":true,"format":{"digitSeparator":true,"places":2}},{"fieldName":"ANY_UUID","label":"ANY_UUID","visible":true},{"fieldName":"globalid","label":"globalid","visible":true},{"fieldName":"OBJECTID","label":"OBJECTID","visible":true,"format":{"digitSeparator":true,"places":2}}],"showAttachments":false,"title":"Aggregation of bigDataFileShares xin3 csv by hexagon bins - Aggregation of bigDataFileShares xin3 csv by hexagon bins","popupElements":[{"type":"fields"}]}},{"id":"15d1ac663d0-layer-1","opacity":1,"title":"MyMapService","url":"https://gis118.arcgisonline.cn/arcgis/rest/services/MyMapService/MapServer","visibility":true,"layerType":"ArcGISMapServiceLayer","itemId":"5d1ec72dc49c436cb4547df7e50785a8"}],"baseMap":{"baseMapLayers":[],"id":"15cf1a61dab-basemap-0","title":"Topographic","elevationLayers":[{"id":"globalElevation","listMode":"hide","title":"Terrain3D","url":"https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer","visibility":true,"layerType":"ArcGISTiledElevationServiceLayer"}]},"version":"1.4","authoringApp":"WebSceneViewer","authoringAppVersion":"10.5.0","presentation":{"slides":[]},"initialState":{"environment":{"lighting":{"datetime":1426395530000,"displayUTCOffset":7}},"viewpoint":{"scale":7525651.004665631,"rotation":358.5726526269468,"targetGeometry":{"x":1.172152354722387E7,"y":2931754.9651887054,"z":1401.3526187865064,"spatialReference":{"wkid":102100,"latestWkid":3857}},"camera":{"position":{"x":1.1720946560564639E7,"y":2908616.633524697,"z":3039970.5823473614,"spatialReference":{"wkid":102100,"latestWkid":3857}},"heading":1.4273473730531656,"tilt":0.3944495355698415}}},"spatialReference":{"wkid":102100,"latestWkid":3857},"viewingMode":"global"}

核心代码:

 var itemURL = portalitem + webscene + "/data";esriRequest(itemURL, {responseType: "json"
    }).then(function (response) {// The requested data
        var Layers = response.data.operationalLayers;//this.config.operationalLayers = response.data.operationalLayers;
        _self._getLayersData(Layers);});
},

arcgis api for javascript从地图如何读取要素相关推荐

  1. Arcgis API for JavaScript在地图上实现手机定位信息的追踪显示

    /* 定义全局变量 */ var ulm_Int = null;//保存手机定位信息轮询setInterval的id var isFirstQuery = null;//定义一个变量保存是否是第一次查 ...

  2. Arcgis api for Javascript + arcgisServer + arcSDE笔记(1)

    最近要搞的项目要用Arcgis api for Javascript做地图模块,自己开始学相关的技术.这是之前整理的笔记,现在传到博客上,也作为学习的记录 0 环境搭建 Arcgis软件统一使用10. ...

  3. 基于ArcGIS API for JavaScript加载百度各种类型切片地图

    文章目录 应用场景 需求分析 效果图 实现代码 原理解读 应用场景 部分项目基于ArcGIS平台,但是甲方只提供部分矢量数据,用作底图的地形图数据没有,表示可以使用百度地图作为底图.所以才会有使用Ar ...

  4. 地图小部件—ArcGIS API for JavaScript

    电子地图和传统的纸质地图最大的区别就是交互的程度不一样,而交互性很大程度上由地图的小部件所控制.传统的纸制地图主要有三个基本的部件(要素):比例尺.指北针.图例,而电子地图有更多的交互性小部件选择,在 ...

  5. 在移动设备中创建ArcGIS API for JavaScript地图应用程序

    本教程将演示如何通过响应式移动专用布局窗口小部件创建移动友好的webapp 1.支持的设备 这个模板支持安卓和IOS横向和纵向姿态,它使用Dojo Mobile框架并包含Dojo标题窗口等小部件. 2 ...

  6. ArcGIS API for javascript创建二维度地图

    1.引用arcgis api for javascript <link rel="stylesheet" href="https://js.arcgis.com/4 ...

  7. ArcGIS API for JavaScript根据两个点坐标在地图上画线

    ArcGIS API for JavaScript根据两个点坐标在地图上画线 比如说a(xxxx,xxxxx),b(xxxx,xxxxx).利用这两个点画一条线 var polyline = new ...

  8. ArcGIS API for JavaScript创建 3D 地图

    1.引用ArcGIS API for JavaScript <link rel="stylesheet" href="https://js.arcgis.com/4 ...

  9. ArcGIS API for JavaScript——地图展示

    ArcGIS API for JavaScript 能够实现的最基本功能就是地图展示,包括地图缩放.平移.定位.实时显示坐标.展示地图要素(指北针.比例尺.图例).切换地图等.本文将详细介绍地图展示的 ...

最新文章

  1. 如何从手机或PC将游戏下载到PlayStation 4
  2. DIY修改博客园背景用【保存图片用】
  3. NDoc使用简要手册的补充
  4. matlab误比特率,[转载]使用Matlab进行误比特率仿真
  5. 漫画:大厂总体 SaaS 化部署,到底什么是 IaaS、PaaS 和 SaaS?
  6. vue-cli3.x正确打包项目,解决静态资源与路由加载无效的问题,history模式下配合使用nginx运行打包后的项目
  7. 【leetcode】Trips and Users
  8. 解析kml文件,提取经纬度信息存入csv
  9. 从投入产出简析直复营销
  10. Number of ways to split should evenly divide the split dimension, but got split_dim 3 (size = 4) and
  11. sql grop by having order by 的用法
  12. JAVA+appium+夜神模拟器实现APP爬虫
  13. 全链通“铭镜”农产品溯源平台介绍分析
  14. appollo消息服务器,搭建Apache apollo消息队列服务、简单访问
  15. 开源 Java 中文分词器 Ansj 作者孙健专访
  16. java课程设计纸牌游戏_java练习项目之纸牌游戏实例源码
  17. 《大魔术师》:给内地闹剧变个“魔术”
  18. 计算机暑期学校心得,2017暑期学习心得体会6篇_2017暑期学习心得体会
  19. 软件开发之硬件扫盲篇)固态硬盘需要了解的知识
  20. 《实用多媒体技术》课程习题及解答

热门文章

  1. 4行代码满分:L1-052 2018我们要赢 (5分)
  2. mysql多个on_在多个查询中插入多行的MySQL ON DUPLICATE KEY UPDATE
  3. 加载gif动图_【知乎编辑技巧】GIF动图 的插入 2020.05
  4. python人脸识别框很小_人脸识别:从传统方法到深度学习
  5. Servlet之间的跳转
  6. mysql启动报错2002_mysql登陆启动报错 ERROR 2002 (HY000) 解决方法
  7. c代码实现 ifft运算_fft算法c语言_matlab fft算法_ifft c语言
  8. python编写函数求n阶调和数_Python实现调和级数的计算
  9. android 蓝牙设置平板电脑,java – BlueCove,笔记本电脑和带蓝牙的Android平板电脑
  10. c语言 error 9,C语言求助(_) c:9: error: syntax error before '[' token