new mapboxgl.supermap.DataFlowService(url, options)
mapboxgl/services/DataFlowService.js, line 9
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
string |
与客户端交互的实时数据服务地址。 |
|||||||||||||||
options |
Object |
加载实时数据可选参数。
|
Fires
- mapboxgl.supermap.DataFlowService#event:broadcastSocketConnected
- mapboxgl.supermap.DataFlowService#event:broadcastSocketError
- mapboxgl.supermap.DataFlowService#event:broadcastFailed
- mapboxgl.supermap.DataFlowService#event:broadcastSucceeded
- mapboxgl.supermap.DataFlowService#event:subscribeSocketError
- mapboxgl.supermap.DataFlowService#event:messageSucceeded
- mapboxgl.supermap.DataFlowService#event:setFilterParamSucceeded
Example
new mapboxgl.supermap.DataFlowService(url)
.queryChart(param,function(result){
//doSomething
})
Extends
Events
-
broadcastFailed
mapboxgl/services/DataFlowService.js, line 51 -
广播失败。
-
broadcastSocketConnected
mapboxgl/services/DataFlowService.js, line 43 -
broadcast Socket 连接成功。
-
broadcastSocketError
mapboxgl/services/DataFlowService.js, line 47 -
broadcast Socket 连接失败。
-
broadcastSucceeded
mapboxgl/services/DataFlowService.js, line 55 -
广播成功。
-
inherited initialized
mapboxgl/services/ServiceBase.js, line 26 -
构造函数构造成功之后触发。
Properties:
Name Type Description this
Object this 对象。
-
messageSucceeded
mapboxgl/services/DataFlowService.js, line 67 -
获取信息成功。
-
setFilterParamSucceeded
mapboxgl/services/DataFlowService.js, line 71 -
设置过滤参数成功。
-
subscribeSocketConnected
mapboxgl/services/DataFlowService.js, line 59 -
订阅数据连接成功。
-
subscribeSocketError
mapboxgl/services/DataFlowService.js, line 63 -
订阅数据连接失败。
-
subscribesucceeded
mapboxgl/services/DataFlowService.js, line 89 -
数据流服务订阅成功后触发。
Properties:
Name Type Description e
Object 事件对象。
Methods
-
broadcast(obj)
mapboxgl/services/DataFlowService.js, line 110 -
加载广播数据。
Name Type Description obj
JSON JSON 格式的要素数据。
-
initBroadcast(){mapboxgl.supermap.DataFlowService}
mapboxgl/services/DataFlowService.js, line 100 -
初始化广播。
Returns:
Type Description mapboxgl.supermap.DataFlowService -
initSubscribe()
mapboxgl/services/DataFlowService.js, line 119 -
初始化订阅数据。
-
setExcludeField(excludeField)
mapboxgl/services/DataFlowService.js, line 129 -
设置排除字段。
Name Type Description excludeField
Object 排除字段。
-
setGeometry(geometry)
mapboxgl/services/DataFlowService.js, line 140 -
设置添加的几何要素数据。
Name Type Description geometry
GeoJSONObject 指定几何范围,该范围内的要素才能被订阅。
-
unBroadcast()
mapboxgl/services/DataFlowService.js, line 159 -
结束加载广播。
-
unSubscribe()
mapboxgl/services/DataFlowService.js, line 151 -
结束订阅数据。