六、Feature Layer

Feature Layer是一种特殊的Graphics layer(继承自Graphics layer),除了像Graphics layer一样包含和显示Graphic features,还能提供:

Editing——编辑(editing控件包含在ArcGIS Toolkit库中,通过feature service来编辑feature layer)

Definition expressions——通过where子句,条件显示某些feature

Time definitions——通过time-aware layer的时间定义,条件显示某些feature

Selection——通过feature的子集,达到显示、编辑、分析的目的

feature layer的三种服务源:

Feature layer source

描述

ArcGIS Server map service

Dynamic (non-cached) ArcGIS Server map services能包含多个feature layers,如:http://./ArcGIS/rest/services/./MapServer/8

ArcGIS Server feature service

如:http://. /ArcGIS/rest/services/./FeatureServer/0

当feature layer在ArcSDE geodatabase中时,支持编辑

MapIt

Mapit包含REST-ful Web service,其table可能spatially-enabled。

Mapit layers不支持Editing和time-awareness。

如:http://./SDS/databases/Demo/dbo.USStates_Geographic

Feature layers的关键成员|属性:(仅Feature layers支持,Graphics layers不支持)

Feature layers成员

描述

Url

服务的url

Where

Query条件显示。where(“1=1”)显示全部

Mode

定义获取features的方式:

Snapshot:获取所有feature,用于较小的datasets或临时data

On Demand:返回当前视窗范围内的feature

Selection Only:初始不返回任何feature,仅仅在作出selection后才返回

OnDemandCacheSize

当Mode=On Demand时,定义客户端缓存大小,用来缓存当前视窗外的feature

FeatureSymbol

定义一个单独symbol,用于rendering一个单独的Graphics时

SelectionColor

定义feature layer中selected graphic features的颜色

TimeExtent

实例化或范围显示feature layer的时间。

该属性为只读,定义于ArcGIS Server map或feature service中。

DisableClientCaching

是否允许客户端缓存。默认为true,不能自动更新客户端显示。

Update

更新客户端显示,用于layer或table contents发生改变时。

Feature layer应用

//添加Symbol命名空间,需要定义Symbol给FeatureSymbol属性

xmlns:esriSymbols="clr-namespace:ESRI.ArcGIS.Client.Symbols;assembly=ESRI.ArcGIS.Client

//定义Symbol

<Grid.Resources>

<esriSymbols:SimpleMarkerSymbol x:Name="MyMarkerSymbol" Color="Green" Style="Diamond" Size="14" />

</Grid.Resources>

//定义FeatureLayer

<esri:Map x:Name="MyMap" Extent="-130,10,-70,60" >

<esri:Map.Layers>

<esri:FeatureLayer ID=""

Url="http://./ArcGIS/rest/services/./MapServer/0"

Where="POP1990 > 75000"

FeatureSymbol="{StaticResource MyMarkerSymbol}" >

</esri:FeatureLayer>

</esri:Map.Layers>

</esri:Map>

效果如下图:各feature叠加在一起,不能有效的反应实际数量。

故采用Clustering方式改进(设置ClusterFeatures属性实现):

//添加命名空间

xmlns:esriSymbols="clr-namespace:ESRI.ArcGIS.Client.Symbols;assembly=ESRI.ArcGIS.Client

xmlns:sys="clr-namespace:System;assembly=mscorlib”

//定义Symbol

<Grid.Resources>

<esriSymbols:SimpleMarkerSymbol x:Name="MyMarkerSymbol" Color="Green" Style="Diamond" Size="14" />

</Grid.Resources>

//定义FeatureLayer

<esri:Map x:Name="MyMap" Extent="-130,10,-70,60" >

<esri:Map.Layers>

<esri:FeatureLayer ID="MyFeatureLayer"

Url="http://./ArcGIS/rest/services/Specialty/./MapServer/0"

Where="POP1990 > 75000">

<esri:FeatureLayer.Clusterer>

<esri:FlareClusterer

FlareBackground="#99FF0000"

FlareForeground="White"

MaximumFlareCount="9" />

</esri:FeatureLayer.Clusterer>

<esri:FeatureLayer.OutFields>

<sys:String>CITY_NAME</sys:String>

<sys:String>POP1990</sys:String>

</esri:FeatureLayer.OutFields>

</esri:FeatureLayer>

</esri:Map.Layers>

</esri:Map>

效果如下:

最新文章

  1. Maven远程仓库的配置
  2. FAT32 FAT区__FAT表解析
  3. #使用while循环输入1 2 3 4 5 6 8 9 10
  4. python解无忧公主的数学时间编程题001.py
  5. Android(java)学习笔记263:Android下的属性动画(Property Animation)
  6. Python 对Twitter中指定话题的Tweet基本元素的频谱分析
  7. memcache和memcached之间的区别和联系
  8. 《Python自然语言处理》第二章-习题解答-练习6
  9. ORACLE 本地冷迁移
  10. mitmproxy,mitmdump
  11. vue过滤器用法实例分析
  12. Feel Good POJ - 2796 (前缀和+单调栈)(详解)
  13. java.lang.StackOverflowError 解决方法
  14. luogu2024 食物链 (并查集)
  15. Java中的Future相关
  16. Actual Time Cost
  17. 原型工具之团队协作: Axure VS Mockplus
  18. gitlab账号注册及分组
  19. Nginx - buffer缓冲区部分
  20. Oracle 11g的Deferred Segment Creation

热门文章

  1. FAFU 1395
  2. zoj3814
  3. linux常用命令:top 命令
  4. python3.4学习笔记(十二) python正则表达式的使用,使用pyspider匹配输出带.html结尾的URL
  5. shell中参数及带色彩打印
  6. 一篇关于Redis的好文章
  7. COOKIE与SESSION、Django的用户认证、From表单
  8. P3313 [SDOI2014]旅行
  9. 07: linux中正则表达式与grep使用
  10. 02: MySQL的安装与基本配置