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);
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string |
标绘图层名称。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
serverUrl |
string |
标绘服务地址。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
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 maxVisibleScalenumber 图层的最大可见比例尺。
-
static setMinVisibleScale(minVisibleScale)
leaflet/mapping/PlottingLayer.js, line 227 -
设置图层的最小可见比例尺。
Name Type Description minVisibleScalenumber 图层的最小可见比例尺。
-
addFeatures(features)
leaflet/mapping/PlottingLayer.js, line 619 -
添加标号。
Name Type Description featuresArray.<PlottingObject> 待添加的标号。
-
createAirDeployment(associatedUuid, subSymbols, uuid, style, options, callback, custom)
leaflet/mapping/PlottingLayer.js, line 2396 -
创建KJBL部署,此接口为异步接口没有返回值,通过 callback 回掉函数处理创建完成后操作。
Name Type Description associatedUuidstring KJBL部署关联的实体对象的唯一ID,即创建该关联实体时的uuid
subSymbolsArray.<SubSymbol> 标号的libID、code及textContent信息。
uuidstring 实体的唯一标识。
stylestyle 指定标号的样式。
optionsObject 指定标号的属性。
Name Type Default Description colNumnumber 1 可选 KJBL部署排列的列数,默认为1。
spacenumber 10 可选 行列之间的间距,默认是10,单位是:0.1mm。
isShowTooltipboolean true 可选 是否显示指示框,默认为显示。
callbackfunction 回调函数。
customObject 用户的自定义属性
-
createAirRoute(arrRoutePts, routeNodes, uuid, lineStyle, options, custom)
leaflet/mapping/PlottingLayer.js, line 2517 -
创建KJ航线。
Name Type Description arrRoutePtsArray.<L.LatLng> 航线点串。
routeNodesArray.<RouteNode> 航站点数组。
uuidstring 实体的唯一标识。
lineStylestyle 航线的样式。
optionsObject 指定标号的属性,扩展参数。
customObject 用户的自定义属性。
-
createArcRegion(centerPoint, radius, startAngle, endAngle, textContent, textPos, uuid, style, options, callback, custom)
leaflet/mapping/PlottingLayer.js, line 2567 -
创建扇形区域(空域、海域、电子卫星覆盖区域、雷达覆盖范围),此接口为异步接口没有返回值,通过 callback 回掉函数处理创建完成后操作。
Name Type Description centerPointL.LatLng 扇形区域的中心点。
radiusstring 扇形区域的半径。
startAnglenumber 扇形区域的起始角。
endAnglenumber 扇形区域的结束角。
textContentstring 扇形区域说明。
textPosnumber 扇形区域说明的位置,为文字角度,-1代表中心点。
uuidstring 实体的唯一标识。
stylestyle 指定标号的样式。
optionsObject 指定标号的属性。
Name Type Description radiusTextstring 可选 半径文字。
radiusPosAnglenumber 可选 半径线文字角度。
radiusLineTypeRadiusLineType 可选 半径线类型。
callbackfunction 可选 回调函数。
customObject 用户的自定义属性。
-
createFlags(features, ratio, uuid)
leaflet/mapping/PlottingLayer.js, line 2541 -
创建多旗。
Name Type Description featuresArray.<GraphicObject> 旗帜标号。
rationumber 多旗间距与旗子高度的比值,默认是0.8
uuidstring 组合对象的唯一ID或FeatureId。
-
createGroupObject(features, uuid){GroupObject}
leaflet/mapping/PlottingLayer.js, line 970 -
创建组合对象。
Name Type Description featuresArray.<GraphicObject> 标号对象。
uuidstring 标号唯一标识。
Returns:
Type Description GroupObject 组合对象。 -
createInterferenceBeam(associatedUuid, positionPoints, uuid, style, options, custom)
leaflet/mapping/PlottingLayer.js, line 1940 -
创建干扰波束。
Name Type Description associatedUuidstring 关联实体对象的唯一ID,即创建该关联实体时的uuid。
positionPointsArray.<L.LatLng> 标号位置点,高度可以由
L.LatLng的tag值保存。uuidstring 实体的唯一标识。
stylestyle 指定标号的样式。
optionsObject 指定标号的属性,扩展参数。
customObject 用户的自定义属性。
-
createLineRelation(startAssociatedUuid, endAssociatedUuid, lineRelationType, uuid, style, options, custom)
leaflet/mapping/PlottingLayer.js, line 1913 -
创建对象间(打击、侦察、干扰等)关系连线。
Name Type Description startAssociatedUuidString 关联对象的唯一ID。
endAssociatedUuidString 关联对象的唯一ID。
lineRelationTypeLineRelationType 连接线类型。
uuidstring 标号唯一标识。
stylestyle 指定标号的样式。
optionsObject 指定标号的属性。
Name Type Default Description subSectionCountnumber 10 可选 连接线划分段数,默认为10。
customObject 用户的自定义属性。
-
createMissileRoute(arrRoutePts, routeNodes, uuid, lineStyle, options, custom)
leaflet/mapping/PlottingLayer.js, line 2493 -
创建DD航线。
Name Type Description arrRoutePtsArray.<L.LatLng> 航线点串。
routeNodesArray.<RouteNode> 航站点数组。
uuidstring 实体的唯一标识。
lineStylestyle 航线的样式。
optionsObject 指定标号的属性,扩展参数。
customObject 用户的自定义属性。
-
createNavyDeployment(associatedUuid, subSymbols, uuid, style, options, callback, custom)
leaflet/mapping/PlottingLayer.js, line 2322 -
创建HJBL部署,此接口为异步接口没有返回值,通过 callback 回掉函数处理创建完成后操作。
Name Type Description associatedUuidstring HJBL部署关联的实体对象的唯一ID,即创建该关联实体时的uuid。
subSymbolsArray.<SubSymbol> 标号的libID、code及textContent信息。
uuidstring 实体的唯一标识。
stylestyle 指定标号的样式。
optionsObject 指定标号的属性。
Name Type Default Description colNumnumber 1 可选 HJBL部署排列的列数,默认为1。
spacenumber 10 可选 行列之间的间距,默认是10,单位是:0.1mm。
textContentstring 可选 注记内容。
callbackfunction 可选 回调函数。
customObject 用户的自定义属性。
-
createNavyRoute(arrRoutePts, routeNodes, uuid, lineStyle, options, custom)
leaflet/mapping/PlottingLayer.js, line 2470 -
创建HJ航线。
Name Type Description arrRoutePtsArray.<L.LatLng> 航线点串。
routeNodesArray.<RouteNode> 航站点数组。
uuidstring 实体的唯一标识
lineStylestyle 航线的样式。
optionsObject 指定标号的属性,扩展参数。
customObject 用户的自定义属性。
-
createSatellite(libID, code, orbitPoints, textContent, uuid, style, options, callback, custom)
leaflet/mapping/PlottingLayer.js, line 1962 -
创建卫星,此接口为异步接口没有返回值,通过 callback 回掉函数处理创建完成后操作。
Name Type Description libIDnumber 标号库ID。
codenumber 标号代码。
orbitPointsArray.<OrbitPoint> 卫星轨道星下点轨迹。
textContentstring 卫星说明。
uuidstring 实体的唯一标识。
stylestyle 指定标号的样式。
optionsObject 指定标号的属性。
Name Type Default Description visibleboolean true 可选 卫星轨道的可见性,默认为可见。
callbackfunction 可选 回调函数。
customObject 用户的自定义属性。
-
createSatelliteTimeWindows(associatedUuid, timeWindows, uuid, style, options, custom)
leaflet/mapping/PlottingLayer.js, line 2033 -
根据卫星轨迹点序号或者时间创建卫星可见时间窗口。(当时间窗类型没有传入,不创建时间窗口)
Name Type Description associatedUuidstring 关联的卫星的唯一ID,即创建该关联实体时的uuid。
timeWindowsArray.<TimeWindowParameter> 卫星可见时间窗(起始轨道点序号或时间、结束轨道点序号或时间、轨道类型序号或时间)数组。
uuidstring 实体的唯一标识。
stylestyle 指定标号的样式。
optionsObject 指定标号的属性。保留参数。
customObject 用户的自定义属性。
-
createSatelliteTimeWindows1(associatedUuid, timeWindows, uuid, style, options, custom)
leaflet/mapping/PlottingLayer.js, line 2057 -
根据卫星轨迹点序号创建卫星可见时间窗口。
Name Type Description associatedUuidstring 关联的卫星的唯一ID,即创建该关联实体时的uuid。
timeWindowsArray.<TimeWindowParameter> 卫星可见时间窗(起始、结束轨道点序号)数组。
uuidstring 实体的唯一标识。
stylestyle 指定标号的样式。
optionsObject 指定标号的属性。保留参数。
customObject 用户的自定义属性。
-
createSatelliteTimeWindows2(associatedUuid, timeWindows, uuid, style, options, custom)
leaflet/mapping/PlottingLayer.js, line 2086 -
根据卫星轨迹时刻创建卫星可见时间窗口。
Name Type Description associatedUuidstring 关联的卫星的唯一ID,即创建该关联实体时的uuid。
timeWindowsArray.<TimeWindowParameter> 卫星可见时间窗(起始、结束轨道点时间)数组。
uuidstring 实体的唯一标识。
stylestyle 指定标号的样式。
optionsObject 指定标号的属性。保留参数。
customObject 用户的自定义属性。
-
createSymbol(libID, code, latlngs, uuid, style, options, callback, custom)
leaflet/mapping/PlottingLayer.js, line 744 -
根据屏幕坐标绘制标号,此接口为异步接口没有返回值,通过 callback 回掉函数处理创建完成后操作,返回对象在plottingLayer中进行管理。
Name Type Description libIDnumber 标号库ID,例:图元标号库ID为0,警用库ID为421。
codenumber | SymbolType 标号在标号库中唯一编码,例:图元中的文本注记编码为34。
latlngsArray.<L.LatLng> 标号位置点。
uuidstring 可选 标号唯一标识。
stylestyle 可选 标号的显示风格。
optionsObject 指定标号的属性。此处仅列出部分标号属性,不同类型标号可设置属性不同,具体可以参照标绘对象的options属性,例如,点标号可参考:
DotSymbol;线面标号,可参考:AlgoSymbol;沿线注记,可参考PathText等。Name Type Default Description serverUrlString 可选 标绘服务地址
symbolDataObject 可选 对接服务器返回的标号数据。
symbolSizeSuperMap.Size 可选 标号大小。
dRotatenumber 0 可选 点标号旋转角度,默认为0。
scaleByMapboolean true 可选 标号是否随图缩放,默认为true。
maxScalenumber 5 可选 标号最大缩放比例,默认为5。
minScalenumber 1 可选 标号最小缩放比例,默认为1。
symbolRankSymbolRank 0 可选 点标号级别。
negativeImageboolean false 可选 是否启用镜像,同水平属性。该属性已弃用。
horizontalMirrorboolean false 可选 是否启用水平镜像,默认为false。
verticalMirrorboolean false 可选 是否启用竖直镜像,默认为false。
positionOffsetboolean false 可选 位置点偏移,默认为false。
positionOffsetTypenumber 可选 偏移线类型,有两种类型:0直线,1线粗渐变。(当positionOffset属性为true时,设置该属性有效。)
positionOffsetXnumber 可选 点标号X方向偏移量。
positionOffsetYnumber 可选 点标号Y方向偏移量。
annotationPositionAnnoPosition AnnoPosition.TOP 可选 标号的注记位置。
enableEditboolean true 可选 标号是否可编辑。
isLockedboolean false 可选 标号是否被锁定。
spacenumber 7 可选 注记与标号的距离,默认为7。
surroundLineTypenumber 可选 衬线类型,点标号有两种类型:0无衬线,1有衬线;线面标号有四种类型:0无衬线,1内侧衬线,2外侧衬线,3双侧衬线。
textContentstring 可选 标号注记内容。
textDisplayboolean true 可选 注记是否显示,默认为true。
pictureFramesPictureFrame 可选 图片对象。
symbolTextsArray.<SymbolText> [] 可选 点标号的标牌,支持设置多个
autoRotationboolean false 可选 点标号是否根据轨迹线方向自动旋转角度;
symbolAnnotationsArray.<SymbolAnnotation> [] 可选 标号的多注记数组。
showPolylineCellBufferGradientboolean 是否显示折线图元缓冲渐变。
callbackfunction 可选 回调函数。
customObject 用户的自定义属性。
-
createSymbolGroup(features){array}
leaflet/mapping/PlottingLayer.js, line 1014 -
创建标号聚合对象
Name Type Description featuresarray 需要聚合的标号数组
Returns:
Type Description array 聚合标号数组 -
createSymbolText(associatedUuid, symbolTexts, uuid, style, options, custom)
leaflet/mapping/PlottingLayer.js, line 2115 -
创建对象标注。
Name Type Description associatedUuidstring 关联实体对象的唯一ID,即创建该关联实体时的uuid。
symbolTextsArray.<SymbolText> 文字内容的数组。
uuidstring 实体的唯一标识。
stylestyle 指定标号的样式。
optionsObject 指定标号的属性。
Name Type Default Description addFrameboolean false 可选 是否添加边框线,默认为false。
customObject 用户的自定义属性。
-
createSymbolText1(associatedUuid, textContents, uuid, style, options, custom)
leaflet/mapping/PlottingLayer.js, line 2140 -
创建对象标注(带指示线)。
Name Type Description associatedUuidstring 关联实体对象的唯一ID,即创建该关联实体时的uuid。
textContentsArray.<string> 文字内容的数组。
uuidstring 实体的唯一标识。
stylestyle 指定标号的样式。
optionsObject 指定标号的属性,扩展参数。
customObject 用户的自定义属性。
-
enableSymScaleDefinition(enable)
leaflet/mapping/PlottingLayer.js, line 370 -
是否启用图层的缩放基准。
Name Type Description enableboolean 是否启用图层的缩放基准。
-
geoJsonToFeature(geoJson, callback)
leaflet/mapping/PlottingLayer.js, line 2641 -
根据 GeoJson 串返回标绘对象。默认添加到激活子图层
Name Type Description geoJsonstring 需要转换标绘对象的GeoJson串。
callbackfunction 可选 回调函数。
-
geoJsonToFeature(geoJson, childPlotLayer, callback)
leaflet/mapping/PlottingLayer.js, line 2651 -
根据 GeoJson 串返回标绘对象。
Name Type Description geoJsonstring 需要转换标绘对象的GeoJson串。
childPlotLayerChildPlotLayer 指定添加的子图层。
callbackfunction 可选 回调函数。
-
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 uuidstring 用户定义的唯一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 featurestring 需要移动的feature。
indexnumber 移动到索引位置。
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 featuresArray.<PlottingObject> 要删除feature的数组
-
setClusterInfoVisible(visible)
leaflet/mapping/PlottingLayer.js, line 1406 -
开启图层聚合后,设置聚合信息是否显示。
Name Type Description visibleboolean 是否显示
-
setClusterRangeVisible(visible)
leaflet/mapping/PlottingLayer.js, line 1390 -
开启图层聚合后,设置聚合范围是否显示。
Name Type Description visibleboolean 是否显示
-
setClusterStyle(style)
leaflet/mapping/PlottingLayer.js, line 1423 -
开启图层聚合后,设置聚合范围与信息样式。
Name Type Description styleobject 样式风格
Name Type Description rangeColorstring 可选 聚合范围颜色
fontBackgroundColorstring 可选 聚合信息背景色
fontBackgroundBorderColorstring 可选 聚合信息背景边框色
-
setEditable(isEditable)
leaflet/mapping/PlottingLayer.js, line 311 -
设置图层的可编辑。
Name Type Description isEditableboolean 图层是否可编辑。
-
setLocked(isLocked)
leaflet/mapping/PlottingLayer.js, line 336 -
设置图层的可锁定。
Name Type Description isLockedboolean 图层的锁定。
-
setSelected(isSelected)
leaflet/mapping/PlottingLayer.js, line 282 -
设置图层的可选择。
Name Type Description isSelectedboolean 图层是否可选择。
-
setSymbolCluster(isCluster, unitSize)
leaflet/mapping/PlottingLayer.js, line 1095 -
设置图层标号是否随缩放聚合
Name Type Description isClusterboolean 是否聚合
unitSizeobject 聚合策略的分块大小
Name Type Description widthnumber 可选 块宽度-经纬度为单位
heightnumber 可选 块高度-经纬度为单位
-
setSymScaleDefinition(图层的缩放基准。, 标号的显示尺寸是否变化。)
leaflet/mapping/PlottingLayer.js, line 388 -
设置图层的缩放基准。
Name Type Description 图层的缩放基准。number 标号的显示尺寸是否变化。boolean -
setUnitSize(unitSize)
leaflet/mapping/PlottingLayer.js, line 1159 -
设置图层标号聚合的块单位
Name Type Description unitSizeobject 聚合策略的分块大小
Name Type Description widthnumber 可选 块宽度-经纬度为单位
heightnumber 可选 块高度-经纬度为单位
-
setVisibility(visibility)
leaflet/mapping/PlottingLayer.js, line 361 -
设置图层可见性,设置图层的隐藏、显示、重绘的相应可见标记。
Name Type Description visibilityboolean 是否显示图层(当前地图的resolution在最大最小resolution之间)。
-
unGroupObject(layer){Array.<GraphicObject>}
leaflet/mapping/PlottingLayer.js, line 996 -
解绑组合对象。
Name Type Description layerGroupObject 组合对象。
Returns:
Type Description Array.<GraphicObject> 标号对象。 -
unGroupSymbol(symbolGroup)
leaflet/mapping/PlottingLayer.js, line 1041 -
解绑标号聚合对象
Name Type Description symbolGrouparray 聚合标号