FeatureLayer
构造函数
FeatureLayer
FeatureLayer是一个单一图层,可以从地图服务、要素服务、
属性
blendMode
图层混合模式
blendMode: "average" | "color-burn" | "color-dodge" | "color" | "darken" | "destination-atop" | "destination-in" | "destination-out" | "destination-over" | "difference" | "exclusion" | "hard-light" | "hue" | "invert" | "lighten" | "lighter" | "luminosity" | "minus" | "multiply" | "normal" | "overlay" | "plus" | "reflect" | "saturation" | "screen" | "soft-light" | "source-atop" | "source-in" | "source-out" | "vivid-light" | "xor"
类型: "average" | "color-burn" | "color-dodge" | "color" | "darken" | "destination-atop" | "destination-in" | "destination-out" | "destination-over" | "difference" | "exclusion" | "hard-light" | "hue" | "invert" | "lighten" | "lighter" | "luminosity" | "minus" | "multiply" | "normal" | "overlay" | "plus" | "reflect" | "saturation" | "screen" | "soft-light" | "source-atop" | "source-in" | "source-out" | "vivid-light" | "xor"
charts
图表配置数组
charts: any[]
类型: any[]
customParameters
自定义参数
customParameters: any
类型: any
dateFieldsTimeZone
日期字段时区
dateFieldsTimeZone: string
类型: string
datesInUnknownTimezone
未知时区日期标识
datesInUnknownTimezone: boolean
类型: boolean
definitionExpression
定义表达式
definitionExpression: string
类型: string
displayField
显示字段
displayField: string
类型: string
displayFilterEnabled
显示过滤器启用状态
displayFilterEnabled: boolean
类型: boolean
editFieldsInfo
编辑器跟踪字段,记录通过要素服务添加或编辑数据的用户以及编辑时间。
editFieldsInfo: EditFieldsInfo
类型: EditFieldsInfo
editingEnabled
确定图层是否可编辑。
editingEnabled: boolean
类型: boolean
editingInfo
指定有关编辑的信息。
editingInfo: EditingInfo
类型: EditingInfo
effect
图层效果,提供各种滤镜功能以实现不同的视觉效果。
effect: Effect
类型: Effect
effectiveCapabilities
描述图层的有效功能,考虑当前登录用户的权限。
effectiveCapabilities: Capabilities
类型: Capabilities
effectiveEditingEnabled
指示考虑当前登录用户权限的情况下图层是否可编辑。
effectiveEditingEnabled: boolean
类型: boolean
fieldsIndex
一个便捷属性,可用于按名称进行不区分大小写的字段查找。
fieldsIndex: FieldsIndex
类型: FieldsIndex
gdbVersion
要素服务数据的地理数据库版本。
gdbVersion: string
类型: string
geometryFieldsInfo
提供系统维护的面积和长度字段及其相应单位的信息。
geometryFieldsInfo: GeometryFieldsInfo
geometryType
图层中要素的几何类型。
geometryType: "multipoint" | "point" | "polygon" | "polyline" | "mesh" | "multipatch"
类型: "multipoint" | "point" | "polygon" | "polyline" | "mesh" | "multipatch"
hasM
指示图层中客户端要素是否具有M(测量)值。
hasM: boolean
类型: boolean
hasZ
指示图层中客户端要素是否具有Z(高程)值。
hasZ: boolean
类型: boolean
isTable
如果图层从服务中的非空间表加载,则返回true。
isTable: boolean
类型: boolean
labelsVisible
指示是否为此图层显示标注。
labelsVisible: boolean
类型: boolean
layerId
要素服务图层的图层ID或图层索引。
layerId: number
类型: number
legendEnabled
指示图层是否将包含在图例中。
legendEnabled: boolean
类型: boolean
maxScale
图层在视图中可见的最大比例尺(最大放大级别)。
maxScale: number
类型: number
minScale
图层在视图中可见的最小比例尺(最小放大级别)。
minScale: number
类型: number
objectIdField
包含图层中每个要素唯一值或标识符的对象ID字段名称。
objectIdField: string
类型: string
outFields
从服务中包含在每个要素中的字段名称数组。
outFields: string[]
类型: string[]
persistenceEnabled
启用图层在WebMap或WebScene中的持久化。
persistenceEnabled: boolean
类型: boolean
preferredTimeZone
服务作者希望日期字段数据显示的IANA时区。
preferredTimeZone: string
类型: string
refreshInterval
图层的刷新间隔(分钟)。
refreshInterval: number
类型: number
relationships
为图层设置的关系数组。
relationships: Relationship
类型: Relationship
returnM
当为true时,指示将返回M值(测量值)。
returnM: boolean
类型: boolean
returnZ
当为true时,指示将始终返回Z值(高程值)。
returnZ: boolean
类型: boolean
screenSizePerspectiveEnabled
在SceneView中对屏幕尺寸的点符号应用透视缩放。
screenSizePerspectiveEnabled: boolean
类型: boolean
serviceDefinitionExpression
服务定义表达式限制可用于显示和查询的要素。
serviceDefinitionExpression: string
类型: string
sourceJSON
Bimflux REST API公开的要素服务元数据JSON。
sourceJSON: any
类型: any
subtypeField
保存子类型ID的字段名称。
subtypeField: string
类型: string
subtypes
图层中定义的子类型数组。
subtypes: Subtype
类型: Subtype
title
用于在图例和图层列表等组件中标识图层的标题。
title: string
类型: string
type
type: "feature"
类型: "feature"
typeIdField
保存要素类型ID的字段名称。
typeIdField: string
类型: string
url
图层、非空间表或服务的REST端点的绝对URL。
url: string
类型: string
访问器
elevationInfo
指定要素在垂直轴(z轴)上的放置方式。
get elevationInfo(): FeatureLayerBaseElevationInfo
返回: FeatureLayerBaseElevationInfo 指定要素在垂直轴(z轴)上的放置方式。
set elevationInfo(value: FeatureLayerBaseElevationInfoProperties): void
返回: void
featureEffect
要素效果可用于突出显示感兴趣的要素。
get featureEffect(): FeatureEffect
返回: FeatureEffect 要素效果可用于突出显示感兴趣的要素。
featureReduction
配置减少视图中要素数量的方法。
get featureReduction(): FeatureReductionBinning | FeatureReductionCluster | FeatureReductionSelection
返回: FeatureReductionBinning | FeatureReductionCluster | FeatureReductionSelection 配置减少视图中要素数量的方法。
set featureReduction(value: FeatureReductionBinningProperties & object | FeatureReductionClusterProperties & object | FeatureReductionSelectionProperties & object): void
参数
- value:
FeatureReductionBinningProperties&object|FeatureReductionClusterProperties&object|FeatureReductionSelectionProperties&object
返回: void
fields
图层中的字段数组。
get fields(): Field[]
返回: Field 图层中的字段数组。
fullExtent
图层的完整范围。
get fullExtent(): Extent
返回: Extent 图层的完整范围。
labelingInfo
此图层的标注定义,指定为标注类数组。
get labelingInfo(): LabelClass[]
返回: LabelClass 此图层的标注定义,指定为标注类数组。
orderBy
确定要素在视图中的绘制顺序。
get orderBy(): OrderByInfo[]
返回: OrderByInfo 确定要素在视图中的绘制顺序。
renderer
分配给图层的渲染器。
get renderer(): RendererUnion
返回: RendererUnion 分配给图层的渲染器。
set renderer(value: HeatmapRendererProperties & object | SimpleRendererProperties & object | UniqueValueRendererProperties & object): void
参数
- value:
HeatmapRendererProperties&object|SimpleRendererProperties&object|UniqueValueRendererProperties&object
返回: void
source
用于创建要素图层的图形对象集合。
get source(): Collection
返回: Collection 用于创建要素图层的图形对象集合。
set source(value: CollectionProperties<Graphic>): void
参数
- value:
CollectionProperties<Graphic>
返回: void
spatialReference
图层的空间参考系统。
get spatialReference(): SpatialReference
返回: SpatialReference 图层的空间参考系统。
set spatialReference(value: SpatialReferenceProperties): void
参数
- value:
SpatialReferenceProperties
返回: void
types
Bimflux REST API公开的要素服务中定义的要素类型数组。
get types(): FeatureType[]
返回: FeatureType Bimflux REST API公开的要素服务中定义的要素类型数组。
方法
addAttachment
向要素添加附件。
addAttachment(feature, attachment): FeatureEditResult
参数
- feature:
Graphic要添加附件的要素对象 - attachment:
HTMLFormElement|FormData包含文件上传字段的HTML表单或FormData对象
返回:Promise<FeatureEditResult>
applyEdits
对图层中的要素应用编辑操作。
applyEdits(edits, options?): EditsResult
参数
- edits:
FeatureLayerApplyEditsEdits包含要添加、更新或删除的要素和附件的对象 - options?:
FeatureLayerApplyEditsOptions编辑要素或附件时指定的附加编辑选项
返回:Promise<EditsResult>
clone
创建此对象的深度克隆。
clone(): this
返回:this
createQuery
创建查询参数对象,用于获取满足图层配置的要素。
createQuery(): Query
返回:Query
deleteAttachments
从要素中删除附件。
deleteAttachments(feature, attachmentIds): FeatureEditResult
参数
- feature:
Graphic包含要删除附件的要素 - attachmentIds:
number要删除的附件ID数组
返回:Promise<FeatureEditResult>
getFeatureType
返回描述要素类型的FeatureType对象。
getField
根据字段名称返回Field实例(不区分大小写)。
getFieldDomain
返回与给定字段名称关联的Domain对象。
getFieldDomain(fieldName, options?): Domain
参数
- fieldName:
string字段名称 - options?:
FeatureLayerBaseGetFieldDomainOptions指定附加选项的对象
返回:Domain
on
on(name, eventHandler): IHandle
参数
name:
"refresh"FeatureLayerRefreshEventHandler###### eventHandler
返回:IHandle
queryAttachments
查询与要素关联的附件信息。
queryAttachments(attachmentQuery, options?): Promise
参数
- attachmentQuery:
AttachmentQueryProperties指定附件查询的参数 - options?:
FeatureLayerQueryAttachmentsOptions包含以下属性的对象
返回:Promise
queryAttributeBins
对要素服务执行属性分箱查询,根据数值或日期字段的范围将要素分组到箱中。
queryAttributeBins(binsQuery, options?): AttributeBinsFeatureSet
参数
- binsQuery:
AttributeBinsQueryProperties指定queryAttributeBins操作的参数,必须设置field属性 - options?:
FeatureLayerQueryAttributeBinsOptions包含以下属性的对象
返回:Promise<AttributeBinsFeatureSet>
queryExtent
对要素服务执行查询并返回满足查询条件的要素的范围。
queryExtent(query?, options?): Promise
参数
- query?:
QueryProperties指定查询的属性和空间过滤器。如果未指定参数,则返回满足图层配置/过滤器的所有要素的范围和数量 - options?:
FeatureLayerQueryExtentOptions包含以下属性的对象
返回:Promise
queryFeatureCount
对要素服务执行查询并返回满足查询条件的要素数量。
queryFeatureCount(query?, options?): Promise
参数
- query?:
QueryProperties指定查询的属性和空间过滤器。如果未指定参数,则返回满足图层配置/过滤器的要素总数 - options?:
FeatureLayerQueryFeatureCountOptions包含以下属性的对象
返回:Promise
queryFeatures
对要素服务执行查询并返回要素集合。
queryFeatures(query?, options?): FeatureSet
参数
- query?:
QueryProperties查询的属性和空间过滤条件。如果未指定参数,则返回满足图层配置/过滤器的所有要素 - options?:
FeatureLayerQueryFeaturesOptions查询选项对象
返回:Promise<FeatureSet>
queryObjectIds
对要素服务执行查询并返回满足条件的要素对象ID数组。
queryObjectIds(query?, options?): Promise
参数
- query?:
QueryProperties查询的属性和空间过滤条件。如果未指定参数,则返回满足图层配置/过滤器的所有要素ID - options?:
FeatureLayerQueryObjectIdsOptions查询选项对象
返回:Promise
queryRelatedFeatures
执行关联查询并返回按源图层或表对象ID分组的相关要素。
queryRelatedFeatures(relationshipQuery, options?): Promise
参数
- relationshipQuery:
RelationshipQueryProperties关联查询参数,指定查询相关要素或记录的条件 - options?:
FeatureLayerQueryRelatedFeaturesOptions查询选项对象
返回:Promise
queryRelatedFeaturesCount
执行关联查询并返回包含键值对的对象,表示相关要素的数量统计。
queryRelatedFeaturesCount(relationshipQuery, options?): Promise
参数
- relationshipQuery:
RelationshipQueryProperties关联查询参数,指定查询相关要素或记录的条件 - options?:
FeatureLayerQueryRelatedFeaturesCountOptions查询选项对象
返回:Promise
queryTopFeatureCount
执行顶级要素查询并返回满足条件的要素或记录数量。
queryTopFeatureCount(topFeaturesQuery, options?): Promise
参数
- topFeaturesQuery:
TopFeaturesQueryProperties顶级要素查询参数,指定属性、空间、时间和顶级过滤条件 - options?:
FeatureLayerQueryTopFeatureCountOptions查询选项对象
返回:Promise
queryTopFeatures
执行顶级要素查询并返回要素集合。
queryTopFeatures(topFeaturesQuery, options?): FeatureSet
参数
- topFeaturesQuery:
TopFeaturesQueryProperties顶级要素查询参数,指定属性、空间、时间和顶级过滤条件 - options?:
FeatureLayerQueryTopFeaturesOptions查询选项对象
返回:Promise<FeatureSet>
queryTopFeaturesExtent
执行顶级要素查询并返回要素的地理范围。
queryTopFeaturesExtent(topFeaturesQuery, options?): Promise
参数
- topFeaturesQuery:
TopFeaturesQueryProperties顶级要素查询参数,指定属性、空间、时间和顶级过滤条件 - options?:
FeatureLayerQueryTopFeaturesExtentOptions查询选项对象
返回:Promise
queryTopObjectIds
执行顶级要素查询并返回满足条件的要素对象ID数组。
queryTopObjectIds(topFeaturesQuery, options?): Promise
参数
- topFeaturesQuery:
TopFeaturesQueryProperties顶级要素查询参数,指定属性、空间、时间和顶级过滤条件 - options?:
FeatureLayerQueryTopObjectIdsOptions查询选项对象
返回:Promise
refresh
刷新图层的所有数据。
refresh(): void
返回:void
updateAttachment
更新要素的现有附件。
updateAttachment(feature, attachmentId, attachment): FeatureEditResult
参数
- feature:
Graphic包含要更新附件的要素 - attachmentId:
number要更新的附件ID - attachment:
HTMLFormElement|FormData包含文件上传字段的HTML表单或FormData对象
返回:Promise<FeatureEditResult>

BIMFlux AI
