new DataFlowService(url, options)
Usage
import { DataFlowService } from '@supermapgis/iclient-mapboxgl';
new DataFlowService(url, options);<script type="text/javascript" src="https://iclient.supermap.io/dist/mapboxgl/iclient-mapboxgl.js"></script>
<script>
new mapboxgl.supermap.DataFlowService({paramsNames});
</script>
mapboxgl/services/DataFlowService.js, line 7
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
string |
数据流服务地址,如 ws://{ip}:{port}/iserver/services/dataflowTest/dataflow 。 |
|||||||||||||||
options |
Object |
参数。
|
Fires
- DataFlowService#event:broadcastSocketConnected
- DataFlowService#event:broadcastSocketError
- DataFlowService#event:broadcastFailed
- DataFlowService#event:broadcastSucceeded
- DataFlowService#event:subscribeSocketError
- DataFlowService#event:messageSucceeded
- DataFlowService#event:setFilterParamSucceeded
Example
new DataFlowService(url)
.queryChart(param,function(result){
//doSomething
})
API Relations
Returned by:
DataFlowService.initBroadcast.
Extends
DataFlowService
-> ServiceBase
Events
-
broadcastFailed
mapboxgl/services/DataFlowService.js, line 52 -
广播失败。
-
broadcastSocketConnected
mapboxgl/services/DataFlowService.js, line 44 -
broadcast Socket 连接成功。
-
broadcastSocketError
mapboxgl/services/DataFlowService.js, line 48 -
broadcast Socket 连接失败。
-
broadcastSucceeded
mapboxgl/services/DataFlowService.js, line 56 -
广播成功。
-
inherited initialized
mapboxgl/services/ServiceBase.js, line 32 -
构造函数构造成功之后触发。
Properties:
Name Type Description thisObject this 对象。
-
messageSucceeded
mapboxgl/services/DataFlowService.js, line 68 -
获取信息成功。
-
setFilterParamSucceeded
mapboxgl/services/DataFlowService.js, line 72 -
设置过滤参数成功。
-
subscribeSocketConnected
mapboxgl/services/DataFlowService.js, line 60 -
订阅数据连接成功。
-
subscribeSocketError
mapboxgl/services/DataFlowService.js, line 64 -
订阅数据连接失败。
-
subscribesucceeded
mapboxgl/services/DataFlowService.js, line 90 -
数据流服务订阅成功后触发。
Properties:
Name Type Description eObject 事件对象。
Methods
-
broadcast(obj)
mapboxgl/services/DataFlowService.js, line 111 -
加载广播数据。
Name Type Description objJSONObject 要素数据。
-
initBroadcast(){DataFlowService}
mapboxgl/services/DataFlowService.js, line 101 -
初始化广播。
Returns:
Type Description DataFlowService - 数据流服务。
-
initSubscribe()
mapboxgl/services/DataFlowService.js, line 120 -
初始化订阅数据。
-
setExcludeField(excludeField)
mapboxgl/services/DataFlowService.js, line 130 -
设置过滤字段。传入此参数,接收到的信息将不包含过滤掉的字段。
Name Type Description excludeFieldObject 过滤字段。
-
setGeometry(geometry)
mapboxgl/services/DataFlowService.js, line 141 -
空间范围,只有在该范围内的要素才能被接收。
Name Type Description geometryGeoJSONObject 空间范围。
-
unBroadcast()
mapboxgl/services/DataFlowService.js, line 160 -
结束加载广播。
-
unSubscribe()
mapboxgl/services/DataFlowService.js, line 152 -
结束订阅数据。