Class: dataFlowViewModel

dataFlowViewModel

数据流组件功能类。

L.supermap.components.dataFlowViewModel(map, dataFlowLayerOptions, options)

leaflet/components/dataflow/DataFlowViewModel.js, line 9
Name Type Description
map L.Map

当前组件所在的地图。

dataFlowLayerOptions Object 可选

数据流服务返回数据数据展示样式,默认采用 ViewModel 默认样式。

options Object

可选参数。

Name Type Description
style function 可选

定义点、线、面要素样式。参数为L.Path-option
function (feature) { return { fillColor: "red", fillOpacity: 1, radius: 6, weight: 0 }; }

onEachFeature function 可选

在创建和设置样式后,将为每个创建的要素调用一次的函数。 用于将事件和弹出窗口附加到要素。 默认情况下,对新创建的图层不执行任何操作。

Version:
  • 9.1.1
Fires

Extends

Members

currentFeaturesArray.<Object>

当前订阅数据流返回的要素数组。

当前 dataFlowLayer 图层对象。

dataFlowStatusboolean

数据流服务当前状态,订阅 "true" 或未订阅 "false" 的状态。

dataFlowUrlstring

数据流地址。

Default Value:
""

mapL.Map

当前组件所在的地图。

popupsStatusboolean

图层 popup 打开 "true" 或关闭 "false" 的状态。

Default Value:
true

Events

dataflowservicesubscribed

leaflet/components/dataflow/DataFlowViewModel.js, line 104

数据流订阅成功后触发。

dataupdated

leaflet/components/dataflow/DataFlowViewModel.js, line 140

数据返回成功之后触发。

Properties:
Name Type Description
result Object

返回的数据。

subscribefailed

leaflet/components/dataflow/DataFlowViewModel.js, line 131

数据流订阅失败后触发。

Properties:
Name Type Description
result Object

返回的数据。

subscribesucceeded

leaflet/components/dataflow/DataFlowViewModel.js, line 123

数据流订阅成功后触发。

Properties:
Name Type Description
result Object

返回的数据。

Methods

cancelSubscribe()

leaflet/components/dataflow/DataFlowViewModel.js, line 166

取消订阅的数据流。

closePopups()

leaflet/components/dataflow/DataFlowViewModel.js, line 195

关闭图层要素弹窗。

openPopups()

leaflet/components/dataflow/DataFlowViewModel.js, line 180

打开图层要素弹窗。

subscribe(dataFlowUrl)

leaflet/components/dataflow/DataFlowViewModel.js, line 95

订阅数据流。

Name Type Description
dataFlowUrl string

数据流服务地址。