Class: DataFlowLayer

DataFlowLayer

数据流图层源。订阅 SuperMap iServer 数据流服务并上图。订阅得到的数据会根据 options.idField 自动更新。

new DataFlowLayer(url, options)

Usage
import { DataFlowLayer } from '@supermapgis/iclient-leaflet';

new DataFlowLayer(url, options);
<script type="text/javascript" src="https://iclient.supermap.io/dist/leaflet/iclient-leaflet.js"></script>
<script>
  new L.supermap.DataFlowLayer({paramsNames});
  // 弃用的写法

  L.supermap.dataFlowLayer(url, options);
</script>
leaflet/overlay/DataFlowLayer.js, line 16
Name Type Description
url string

服务地址。

options Object

参数。

Name Type Default Description
render Object 'normal' 可选

绘制方式。可选值为 'normal','mapv'。 'normal' 表示以 {( L.LatLng|L.Polyline|L.Polygon|L.Marker )} 方式绘制数据流。'mapv' 表示以 MapVLayer 方式绘制实时数据。

geometry GeoJSONObject 可选

空间范围,只有在该范围内的要素才能被接收。

prjCoordSys Object 可选

投影坐标对象。

excludeField string 可选

过滤字段。传入此参数,接收到的信息将不包含过滤掉的字段。

idField string 'id' 可选

要素属性中表示唯一标识的字段。

pointToLayer function 可选

定义点要素如何绘制在地图上的函数。当接收到数据时,内部会调用此函数,并传递 GeoJSON 点要素及其经纬度坐标。 function(geoJsonPoint, latlng) { return L.marker(latlng); }

style function 可选

定义点、线、面要素样式的函数。返回参数为L.Path-option。当接收到数据时,内部会调用此函数,并传递 GeoJSON 要素。
function (feature) { return { fillColor: "red", fillOpacity: 1, radius: 6, weight: 0 }; }

deg function | number 可选

定义图标的旋转角度。options.render 为 mapv 时有效。
function (feature,latlng) { return feature.properties['rotate']; }

Fires

Extends

DataFlowLayer -> L.LayerGroup

Events

dataupdated

leaflet/overlay/DataFlowLayer.js, line 147

图层数据更新成功后触发。

Properties:
Name Type Description
layer Object

更新数据成功的图层。

data Object

更新的要素。

setfilterparamsucceeded

leaflet/overlay/DataFlowLayer.js, line 99

过滤参数设置成功后触发。

Properties:
Name Type Description
e Object

事件对象。

subscribefailed

leaflet/overlay/DataFlowLayer.js, line 91

初始化失败后触发。

Properties:
Name Type Description
e Object

事件对象。

subscribesucceeded

leaflet/overlay/DataFlowLayer.js, line 84

初始化成功后触发。

Properties:
Name Type Description
e Object

事件对象。

Methods

setExcludeField(excludeField)

leaflet/overlay/DataFlowLayer.js, line 122

设置过滤字段。传入此参数,接收到的信息将不包含过滤掉的字段。

Name Type Description
excludeField string

过滤字段。

setGeometry(geometry)

leaflet/overlay/DataFlowLayer.js, line 133

设置空间范围,只有在该范围内的要素才能被接收。

Name Type Description
geometry GeoJSONObject

待设置的 GeoJSON 几何要素对象。