admin管理员组

文章数量:1650776

ArcGIS API for JS 之 FeatureLayer (一)FeatureLayer的创建

最近项目中用到了ArcGIS API中的FeatureLayer进行数据的前端显示、处理等操作,踩了很多坑,记录如下——

目录

  • ArcGIS API for JS 之 FeatureLayer (一)FeatureLayer的创建
  • 1.FeatureLayer简介
  • 2.FeatureLayer图层初始化
  • 3.FeatureLayer图层过滤(definitionExpression)
  • 4.FeatureLayer图层渲染(renderer)


1.FeatureLayer简介

A FeatureLayer is a single layer that can be created from a Map Service or Feature Service.
FeatureLayer(要素图层)可以利用MapService或者FeatureService创建。

The layer can be either a spatial (has geographic features) or non-spatial (table).
图层可以是空间化的也可以是非空间化的。

Spatial layer is composed of discrete features, each of which has a Geometry that allows it to be rendered in either a 2D MapView or 3D SceneView as a graphic with spatial context.
空间化的图层由离散的feature组成,这些feature都具有geometry,可以用来在二三维地图上渲染。

Features also contain data attributes that provide additional information about the real-world feature it represents; attributes may be viewed in popup windows and used for rendering the layer.
feature的属性信息可以描述这个要素的相关附加信息。这些属性信息可以在弹窗内展示,也可用于渲染图层。

FeatureLayers may be queried, analyzed, and rendered to visualize data in a spatial context.
FeatureLayers可用以查询、分析以及在空间环境中渲染可视化数据。

2.FeatureLayer图层初始化

通过FeatureLayer构造函数进行初始化,如果用feature service服务创建图层,则url是必须属性。

require(["esri/layers/FeatureLayer"],function (FeatureLayer) {
   
	this.myFeatureLayer= new FeatureLayer({
   

本文标签: APIArcGISFeatureLayerjs