Class: PlottingLayer

PlottingLayer

标绘图层。

new PlottingLayer(name, serverUrl, options)

Usage
// 浏览器
<script type="text/javascript" src="../../web/libs/plotting/leaflet/11.3.0/iclient-plot-leaflet-es6.min.js"></script>
<script>
  new L.supermap.plotting.PlottingLayer(name, serverUrl, options);
  
  // 另一种写法
  L.supermap.plotting.plottingLayer(name, serverUrl, options);

  
</script>

// ES6 Import
import { PlottingLayer } from '../../public/iclient-plot/iclient-plot-leaflet-es6.min.js';

new PlottingLayer(name, serverUrl, options);

leaflet/mapping/PlottingLayer.js, line 17
Name Type Description
name string

标绘图层名称。

serverUrl string

标绘服务地址。

options Object

标绘图层参数。

Name Type Default Description
caption string "图元层" 可选

图层显示名称。

tolerancePixel number 5 可选

选择标号的容限,单位是像素。

isLocked boolean false 可选

图层锁定。

isEditable boolean true 可选

图层可编辑。

isSelected boolean true 可选

图层可选择。

visibility boolean true 可选

图层可见。

minVisibleScale number 0 可选

图层最小可见比例尺。

maxVisibleScale number 0 可选

图层最大可见比例尺。

enableSymScale boolean false 可选

是否开启图层缩放基准。

symScaleDefinition number null 可选

图层的缩放基准,默认是标绘图的缩放基准, 当开启图层缩放基准时,设置基准尺寸才有效;当不设置基准尺寸创建时,默认当前尺寸为缩放基准。

serviceParams Object

标绘服务的服务参数。

Name Type Default Description
proxy string 可选

服务代理地址。

withCredentials boolean false 可选

请求是否携带 cookie。

crossOrigin boolean 可选

是否允许跨域请求。

headers Object 可选

请求头。

clusterStyle Object 可选

图层开启聚合后显示范围与信息的风格

Name Type Description
fontBackgroundColor Object 可选

图层开启聚合后显示信息背景色

fontBackgroundBorderColor Object 可选

图层开启聚合后显示信息边框色

rangeColor Object 可选

图层开启聚合后显示范围颜色

Methods

static clearVisibleScale()

leaflet/mapping/PlottingLayer.js, line 264

取消可见范围设置。

static getMaxVisibleScale(){number}

leaflet/mapping/PlottingLayer.js, line 239

获取图层的最大可见比例尺。

Returns:
Type Description
number 图层的最大可见比例尺。

static getMinVisibleScale(){number}

leaflet/mapping/PlottingLayer.js, line 214

获取图层的最小可见比例尺。

Returns:
Type Description
number 图层的最小可见比例尺。

static setMaxVisibleScale(maxVisibleScale)

leaflet/mapping/PlottingLayer.js, line 252

设置图层的最大可见比例尺。

Name Type Description
maxVisibleScale number

图层的最大可见比例尺。

static setMinVisibleScale(minVisibleScale)

leaflet/mapping/PlottingLayer.js, line 227

设置图层的最小可见比例尺。

Name Type Description
minVisibleScale number

图层的最小可见比例尺。

addFeatures(features)

leaflet/mapping/PlottingLayer.js, line 619

添加标号。

Name Type Description
features Array.<PlottingObject>

待添加的标号。

createAirDeployment(associatedUuid, subSymbols, uuid, style, options, callback, custom)

leaflet/mapping/PlottingLayer.js, line 2396

创建KJBL部署,此接口为异步接口没有返回值,通过 callback 回掉函数处理创建完成后操作。

Name Type Description
associatedUuid string

KJBL部署关联的实体对象的唯一ID,即创建该关联实体时的uuid

subSymbols Array.<SubSymbol>

标号的libID、code及textContent信息。

uuid string

实体的唯一标识。

style style

指定标号的样式。

options Object

指定标号的属性。

Name Type Default Description
colNum number 1 可选

KJBL部署排列的列数,默认为1。

space number 10 可选

行列之间的间距,默认是10,单位是:0.1mm。

isShowTooltip boolean true 可选

是否显示指示框,默认为显示。

callback function

回调函数。

custom Object

用户的自定义属性

createAirRoute(arrRoutePts, routeNodes, uuid, lineStyle, options, custom)

leaflet/mapping/PlottingLayer.js, line 2517

创建KJ航线。

Name Type Description
arrRoutePts Array.<L.LatLng>

航线点串。

routeNodes Array.<RouteNode>

航站点数组。

uuid string

实体的唯一标识。

lineStyle style

航线的样式。

options Object

指定标号的属性,扩展参数。

custom Object

用户的自定义属性。

createArcRegion(centerPoint, radius, startAngle, endAngle, textContent, textPos, uuid, style, options, callback, custom)

leaflet/mapping/PlottingLayer.js, line 2567

创建扇形区域(空域、海域、电子卫星覆盖区域、雷达覆盖范围),此接口为异步接口没有返回值,通过 callback 回掉函数处理创建完成后操作。

Name Type Description
centerPoint L.LatLng

扇形区域的中心点。

radius string

扇形区域的半径。

startAngle number

扇形区域的起始角。

endAngle number

扇形区域的结束角。

textContent string

扇形区域说明。

textPos number

扇形区域说明的位置,为文字角度,-1代表中心点。

uuid string

实体的唯一标识。

style style

指定标号的样式。

options Object

指定标号的属性。

Name Type Description
radiusText string 可选

半径文字。

radiusPosAngle number 可选

半径线文字角度。

radiusLineType RadiusLineType 可选

半径线类型。

callback function 可选

回调函数。

custom Object

用户的自定义属性。

createFlags(features, ratio, uuid)

leaflet/mapping/PlottingLayer.js, line 2541

创建多旗。

Name Type Description
features Array.<GraphicObject>

旗帜标号。

ratio number

多旗间距与旗子高度的比值,默认是0.8

uuid string

组合对象的唯一ID或FeatureId。

createGroupObject(features, uuid){GroupObject}

leaflet/mapping/PlottingLayer.js, line 970

创建组合对象。

Name Type Description
features Array.<GraphicObject>

标号对象。

uuid string

标号唯一标识。

Returns:
Type Description
GroupObject 组合对象。

createInterferenceBeam(associatedUuid, positionPoints, uuid, style, options, custom)

leaflet/mapping/PlottingLayer.js, line 1940

创建干扰波束。

Name Type Description
associatedUuid string

关联实体对象的唯一ID,即创建该关联实体时的uuid。

positionPoints Array.<L.LatLng>

标号位置点,高度可以由 L.LatLng 的tag值保存。

uuid string

实体的唯一标识。

style style

指定标号的样式。

options Object

指定标号的属性,扩展参数。

custom Object

用户的自定义属性。

createLineRelation(startAssociatedUuid, endAssociatedUuid, lineRelationType, uuid, style, options, custom)

leaflet/mapping/PlottingLayer.js, line 1913

创建对象间(打击、侦察、干扰等)关系连线。

Name Type Description
startAssociatedUuid String

关联对象的唯一ID。

endAssociatedUuid String

关联对象的唯一ID。

lineRelationType LineRelationType

连接线类型。

uuid string

标号唯一标识。

style style

指定标号的样式。

options Object

指定标号的属性。

Name Type Default Description
subSectionCount number 10 可选

连接线划分段数,默认为10。

custom Object

用户的自定义属性。

createMissileRoute(arrRoutePts, routeNodes, uuid, lineStyle, options, custom)

leaflet/mapping/PlottingLayer.js, line 2493

创建DD航线。

Name Type Description
arrRoutePts Array.<L.LatLng>

航线点串。

routeNodes Array.<RouteNode>

航站点数组。

uuid string

实体的唯一标识。

lineStyle style

航线的样式。

options Object

指定标号的属性,扩展参数。

custom Object

用户的自定义属性。

createNavyDeployment(associatedUuid, subSymbols, uuid, style, options, callback, custom)

leaflet/mapping/PlottingLayer.js, line 2322

创建HJBL部署,此接口为异步接口没有返回值,通过 callback 回掉函数处理创建完成后操作。

Name Type Description
associatedUuid string

HJBL部署关联的实体对象的唯一ID,即创建该关联实体时的uuid。

subSymbols Array.<SubSymbol>

标号的libID、code及textContent信息。

uuid string

实体的唯一标识。

style style

指定标号的样式。

options Object

指定标号的属性。

Name Type Default Description
colNum number 1 可选

HJBL部署排列的列数,默认为1。

space number 10 可选

行列之间的间距,默认是10,单位是:0.1mm。

textContent string 可选

注记内容。

callback function 可选

回调函数。

custom Object

用户的自定义属性。

createNavyRoute(arrRoutePts, routeNodes, uuid, lineStyle, options, custom)

leaflet/mapping/PlottingLayer.js, line 2470

创建HJ航线。

Name Type Description
arrRoutePts Array.<L.LatLng>

航线点串。

routeNodes Array.<RouteNode>

航站点数组。

uuid string

实体的唯一标识

lineStyle style

航线的样式。

options Object

指定标号的属性,扩展参数。

custom Object

用户的自定义属性。

createSatellite(libID, code, orbitPoints, textContent, uuid, style, options, callback, custom)

leaflet/mapping/PlottingLayer.js, line 1962

创建卫星,此接口为异步接口没有返回值,通过 callback 回掉函数处理创建完成后操作。

Name Type Description
libID number

标号库ID。

code number

标号代码。

orbitPoints Array.<OrbitPoint>

卫星轨道星下点轨迹。

textContent string

卫星说明。

uuid string

实体的唯一标识。

style style

指定标号的样式。

options Object

指定标号的属性。

Name Type Default Description
visible boolean true 可选

卫星轨道的可见性,默认为可见。

callback function 可选

回调函数。

custom Object

用户的自定义属性。

createSatelliteTimeWindows(associatedUuid, timeWindows, uuid, style, options, custom)

leaflet/mapping/PlottingLayer.js, line 2033

根据卫星轨迹点序号或者时间创建卫星可见时间窗口。(当时间窗类型没有传入,不创建时间窗口)

Name Type Description
associatedUuid string

关联的卫星的唯一ID,即创建该关联实体时的uuid。

timeWindows Array.<TimeWindowParameter>

卫星可见时间窗(起始轨道点序号或时间、结束轨道点序号或时间、轨道类型序号或时间)数组。

uuid string

实体的唯一标识。

style style

指定标号的样式。

options Object

指定标号的属性。保留参数。

custom Object

用户的自定义属性。

createSatelliteTimeWindows1(associatedUuid, timeWindows, uuid, style, options, custom)

leaflet/mapping/PlottingLayer.js, line 2057

根据卫星轨迹点序号创建卫星可见时间窗口。

Name Type Description
associatedUuid string

关联的卫星的唯一ID,即创建该关联实体时的uuid。

timeWindows Array.<TimeWindowParameter>

卫星可见时间窗(起始、结束轨道点序号)数组。

uuid string

实体的唯一标识。

style style

指定标号的样式。

options Object

指定标号的属性。保留参数。

custom Object

用户的自定义属性。

createSatelliteTimeWindows2(associatedUuid, timeWindows, uuid, style, options, custom)

leaflet/mapping/PlottingLayer.js, line 2086

根据卫星轨迹时刻创建卫星可见时间窗口。

Name Type Description
associatedUuid string

关联的卫星的唯一ID,即创建该关联实体时的uuid。

timeWindows Array.<TimeWindowParameter>

卫星可见时间窗(起始、结束轨道点时间)数组。

uuid string

实体的唯一标识。

style style

指定标号的样式。

options Object

指定标号的属性。保留参数。

custom Object

用户的自定义属性。

createSymbol(libID, code, latlngs, uuid, style, options, callback, custom)

leaflet/mapping/PlottingLayer.js, line 744

根据屏幕坐标绘制标号,此接口为异步接口没有返回值,通过 callback 回掉函数处理创建完成后操作,返回对象在plottingLayer中进行管理。

Name Type Description
libID number

标号库ID,例:图元标号库ID为0,警用库ID为421。

code number | SymbolType

标号在标号库中唯一编码,例:图元中的文本注记编码为34。

latlngs Array.<L.LatLng>

标号位置点。

uuid string 可选

标号唯一标识。

style style 可选

标号的显示风格。

options Object

指定标号的属性。此处仅列出部分标号属性,不同类型标号可设置属性不同,具体可以参照标绘对象的options属性,例如,点标号可参考:DotSymbol;线面标号,可参考:AlgoSymbol;沿线注记,可参考PathText等。

Name Type Default Description
serverUrl String 可选

标绘服务地址

symbolData Object 可选

对接服务器返回的标号数据。

symbolSize SuperMap.Size 可选

标号大小。

dRotate number 0 可选

点标号旋转角度,默认为0。

scaleByMap boolean true 可选

标号是否随图缩放,默认为true。

maxScale number 5 可选

标号最大缩放比例,默认为5。

minScale number 1 可选

标号最小缩放比例,默认为1。

symbolRank SymbolRank 0 可选

点标号级别。

negativeImage boolean false 可选

是否启用镜像,同水平属性。该属性已弃用。

horizontalMirror boolean false 可选

是否启用水平镜像,默认为false。

verticalMirror boolean false 可选

是否启用竖直镜像,默认为false。

positionOffset boolean false 可选

位置点偏移,默认为false。

positionOffsetType number 可选

偏移线类型,有两种类型:0直线,1线粗渐变。(当positionOffset属性为true时,设置该属性有效。)

positionOffsetX number 可选

点标号X方向偏移量。

positionOffsetY number 可选

点标号Y方向偏移量。

annotationPosition AnnoPosition AnnoPosition.TOP 可选

标号的注记位置。

enableEdit boolean true 可选

标号是否可编辑。

isLocked boolean false 可选

标号是否被锁定。

space number 7 可选

注记与标号的距离,默认为7。

surroundLineType number 可选

衬线类型,点标号有两种类型:0无衬线,1有衬线;线面标号有四种类型:0无衬线,1内侧衬线,2外侧衬线,3双侧衬线。

textContent string 可选

标号注记内容。

textDisplay boolean true 可选

注记是否显示,默认为true。

pictureFrames PictureFrame 可选

图片对象。

symbolTexts Array.<SymbolText> [] 可选

点标号的标牌,支持设置多个

autoRotation boolean false 可选

点标号是否根据轨迹线方向自动旋转角度;

symbolAnnotations Array.<SymbolAnnotation> [] 可选

标号的多注记数组。

showPolylineCellBufferGradient boolean

是否显示折线图元缓冲渐变。

callback function 可选

回调函数。

custom Object

用户的自定义属性。

createSymbolGroup(features){array}

leaflet/mapping/PlottingLayer.js, line 1014

创建标号聚合对象

Name Type Description
features array

需要聚合的标号数组

Returns:
Type Description
array 聚合标号数组

createSymbolText(associatedUuid, symbolTexts, uuid, style, options, custom)

leaflet/mapping/PlottingLayer.js, line 2115

创建对象标注。

Name Type Description
associatedUuid string

关联实体对象的唯一ID,即创建该关联实体时的uuid。

symbolTexts Array.<SymbolText>

文字内容的数组。

uuid string

实体的唯一标识。

style style

指定标号的样式。

options Object

指定标号的属性。

Name Type Default Description
addFrame boolean false 可选

是否添加边框线,默认为false。

custom Object

用户的自定义属性。

createSymbolText1(associatedUuid, textContents, uuid, style, options, custom)

leaflet/mapping/PlottingLayer.js, line 2140

创建对象标注(带指示线)。

Name Type Description
associatedUuid string

关联实体对象的唯一ID,即创建该关联实体时的uuid。

textContents Array.<string>

文字内容的数组。

uuid string

实体的唯一标识。

style style

指定标号的样式。

options Object

指定标号的属性,扩展参数。

custom Object

用户的自定义属性。

enableSymScaleDefinition(enable)

leaflet/mapping/PlottingLayer.js, line 370

是否启用图层的缩放基准。

Name Type Description
enable boolean

是否启用图层的缩放基准。

geoJsonToFeature(geoJson, callback)

leaflet/mapping/PlottingLayer.js, line 2641

根据 GeoJson 串返回标绘对象。默认添加到激活子图层

Name Type Description
geoJson string

需要转换标绘对象的GeoJson串。

callback function 可选

回调函数。

geoJsonToFeature(geoJson, childPlotLayer, callback)

leaflet/mapping/PlottingLayer.js, line 2651

根据 GeoJson 串返回标绘对象。

Name Type Description
geoJson string

需要转换标绘对象的GeoJson串。

childPlotLayer ChildPlotLayer

指定添加的子图层。

callback function 可选

回调函数。

getAllSymbolGroups(){array}

leaflet/mapping/PlottingLayer.js, line 1058

获取当前图层所有聚合对象

Returns:
Type Description
array 聚合对象数组

getEditable(){boolean}

leaflet/mapping/PlottingLayer.js, line 302

获取图层的可编辑。

Returns:
Type Description
boolean 返回图层是否可编辑。

getFeatureByUuid(uuid){PlottingObject}

leaflet/mapping/PlottingLayer.js, line 511

根据用户定义的唯一ID获取图层上指定的feature。

Name Type Description
uuid string

用户定义的唯一ID。

Returns:
Type Description
PlottingObject 返回图层上指定的feature。

getFeatures(){Array.<PlottingObject>}

leaflet/mapping/PlottingLayer.js, line 709

获取当前图层所有的矢量要素。

Returns:
Type Description
Array.<PlottingObject> 返回当前图层所有的矢量要素。

getLocked(){boolean}

leaflet/mapping/PlottingLayer.js, line 327

获取图层的可锁定。

Returns:
Type Description
boolean 返回图层是否锁定。

getSelected(){boolean}

leaflet/mapping/PlottingLayer.js, line 273

获取图层的可选择。

Returns:
Type Description
boolean 返回图层是否可选择。

getSymScaleDefinition(){number}

leaflet/mapping/PlottingLayer.js, line 379

获取图层的缩放基准。

Returns:
Type Description
number 图层的缩放基准。

getVisibility(){boolean}

leaflet/mapping/PlottingLayer.js, line 352

获取图层的可见性。

Returns:
Type Description
boolean 返回图层是否可见。

moveTo(feature, index){PlottingObject}

leaflet/mapping/PlottingLayer.js, line 478

移动feature到指定位置。

Name Type Description
feature string

需要移动的feature。

index number

移动到索引位置。

Returns:
Type Description
PlottingObject 返回图层上指定的feature。

removeAllFeatures()

leaflet/mapping/PlottingLayer.js, line 718

清除当前图层所有的矢量要素。

removeFeatures(features)

leaflet/mapping/PlottingLayer.js, line 682

从当前图层中删除feature。这个函数擦除所有传递进来的矢量要素。 参数中的feature数组中的每一项,必须是已经添加到当前图层中的feature, 如果无法确定feature数组,则可以调用removeAllFeatures来删除所有feature。 如果要删除的feature数组中的元素特别多,推荐使用removeAllFeatures, 删除所有feature后再重新添加。这样效率会更高。

Name Type Description
features Array.<PlottingObject>

要删除feature的数组

setClusterInfoVisible(visible)

leaflet/mapping/PlottingLayer.js, line 1406

开启图层聚合后,设置聚合信息是否显示。

Name Type Description
visible boolean

是否显示

setClusterRangeVisible(visible)

leaflet/mapping/PlottingLayer.js, line 1390

开启图层聚合后,设置聚合范围是否显示。

Name Type Description
visible boolean

是否显示

setClusterStyle(style)

leaflet/mapping/PlottingLayer.js, line 1423

开启图层聚合后,设置聚合范围与信息样式。

Name Type Description
style object

样式风格

Name Type Description
rangeColor string 可选

聚合范围颜色

fontBackgroundColor string 可选

聚合信息背景色

fontBackgroundBorderColor string 可选

聚合信息背景边框色

setEditable(isEditable)

leaflet/mapping/PlottingLayer.js, line 311

设置图层的可编辑。

Name Type Description
isEditable boolean

图层是否可编辑。

setLocked(isLocked)

leaflet/mapping/PlottingLayer.js, line 336

设置图层的可锁定。

Name Type Description
isLocked boolean

图层的锁定。

setSelected(isSelected)

leaflet/mapping/PlottingLayer.js, line 282

设置图层的可选择。

Name Type Description
isSelected boolean

图层是否可选择。

setSymbolCluster(isCluster, unitSize)

leaflet/mapping/PlottingLayer.js, line 1095

设置图层标号是否随缩放聚合

Name Type Description
isCluster boolean

是否聚合

unitSize object

聚合策略的分块大小

Name Type Description
width number 可选

块宽度-经纬度为单位

height number 可选

块高度-经纬度为单位

setSymScaleDefinition(图层的缩放基准。, 标号的显示尺寸是否变化。)

leaflet/mapping/PlottingLayer.js, line 388

设置图层的缩放基准。

Name Type Description
图层的缩放基准。 number
标号的显示尺寸是否变化。 boolean

setUnitSize(unitSize)

leaflet/mapping/PlottingLayer.js, line 1159

设置图层标号聚合的块单位

Name Type Description
unitSize object

聚合策略的分块大小

Name Type Description
width number 可选

块宽度-经纬度为单位

height number 可选

块高度-经纬度为单位

setVisibility(visibility)

leaflet/mapping/PlottingLayer.js, line 361

设置图层可见性,设置图层的隐藏、显示、重绘的相应可见标记。

Name Type Description
visibility boolean

是否显示图层(当前地图的resolution在最大最小resolution之间)。

unGroupObject(layer){Array.<GraphicObject>}

leaflet/mapping/PlottingLayer.js, line 996

解绑组合对象。

Name Type Description
layer GroupObject

组合对象。

Returns:
Type Description
Array.<GraphicObject> 标号对象。

unGroupSymbol(symbolGroup)

leaflet/mapping/PlottingLayer.js, line 1041

解绑标号聚合对象

Name Type Description
symbolGroup array

聚合标号