Class: MovingTargetLayer

MovingTargetLayer

动目标图层类。

new MovingTargetLayer(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.MovingTargetLayer(name, serverUrl, options);
  
  // 另一种写法
  L.supermap.plotting.movingTargetLayer(name, serverUrl, options);

  
</script>

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

new MovingTargetLayer(name, serverUrl, options);

leaflet/mapping/MovingTargetLayer.js, line 8
Name Type Description
name string

动目标图层名称。

serverUrl string

标绘服务地址。

options Object

动目标图层参数。

Name Type Default Description
isLocked boolean false 可选

图层锁定。

isEditable boolean true 可选

图层可编辑。

isSelected boolean true 可选

图层可选择。

visibility boolean true 可选

图层可见。

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 可选

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

Extends

Members

featuresArray.<PlottingObject>

标号对象

serverUrlstring

表示标绘服务的URI

Methods

addFeatures(features)

leaflet/mapping/MovingTargetLayer.js, line 2037

添加标号对象。

Name Type Description
features Array.<GraphicObject>

标号对象。

createAim(viewAssociatedUuid, associatedUuid, options){Aim}

leaflet/mapping/MovingTargetLayer.js, line 235

通过标号关联id创建瞄准特效。

Name Type Description
viewAssociatedUuid string

观察点关联标号id

associatedUuid string

瞄准点关联标号id

options object

瞄准参数

Name Type Description
loop boolean 可选

瞄准闪烁是否循环。

barkTimes number 可选

瞄准闪烁次数,若循环则不生效。

barkInterval number 可选

瞄准闪烁间隔时间,单为毫秒

radius number 可选

瞄准对象半径

radiusUnit boolean 可选

瞄准圆半径单位类型(默认为像素)。

style Object 可选

瞄准样式。

Name Type Description
aimTargetColor string 可选

瞄准颜色。

aimLineColor string 可选

瞄准线颜色。

aimLineWeight number 可选

瞄准线线宽。

aimLineOpacity number 可选

瞄准线透明度。

aimLineDashArray number 可选

瞄准线虚线间隔长度。

Returns:
Type Description
Aim 瞄准对象

createAimByPosition(latlngs, options){Aim}

leaflet/mapping/MovingTargetLayer.js, line 263

通过位置点创建瞄准特效。

Name Type Description
latlngs Array.<L.LatLng>

瞄准起始点位置数组

options object

瞄准参数

Name Type Description
barkTimes number 可选

瞄准闪烁次数,若循环则不生效。

barkInterval number 可选

瞄准闪烁间隔时间,单为毫秒

radius number 可选

瞄准对象半径

radiusUnit boolean 可选

瞄准圆半径单位类型(默认为像素)。

style Object 可选

瞄准样式。

Name Type Description
aimTargetColor string 可选

瞄准颜色。

aimLineColor string 可选

瞄准线颜色。

aimLineWeight number 可选

瞄准线线宽。

aimLineOpacity number 可选

瞄准线透明度。

aimLineDashArray number 可选

瞄准线虚线间隔长度。

Returns:
Type Description
Aim 瞄准对象

createBoom(associatedUuid, options){Boom}

leaflet/mapping/MovingTargetLayer.js, line 289

通过标号关联id创建爆炸特效。

Name Type Description
associatedUuid string

关联标号id

options object

爆炸参数

Name Type Description
boomTimes object 可选

爆炸次数

Returns:
Type Description
Boom 爆炸对象

createBoomByPosition(latlng, options){Boom}

leaflet/mapping/MovingTargetLayer.js, line 306

通过位置点创建爆炸特效。

Name Type Description
latlng L.LatLng

爆炸位置点

options object

爆炸参数

Name Type Description
boomTimes object 可选

爆炸次数

Returns:
Type Description
Boom 爆炸对象
leaflet/mapping/MovingTargetLayer.js, line 323

通过标号关联id数组创建通讯链路特效。

Name Type Description
senderUuid string

通讯链路发送信号的标号uuid

receiverUuid string

通讯链路接收信号的标号uuid

options object

通讯链路参数

Name Type Description
dashSpeed number 可选

通讯链路移动速度。

style Object 可选

通讯链路样式。

Name Type Description
weight number 可选

通讯链路线宽。

movePathColor string 可选

通讯链路移动线路颜色。

movePathOpacity number 可选

通讯链路移动线路透明度。

dashArray string 可选

通讯链路短线与间隔的长度。

staticPathColor string 可选

通讯链路静态线路颜色。

staticPathOpacity number 可选

通讯链路静态线路透明度。

Returns:
Type Description
CommunicationLink 通讯链路对象

createCommunicationLinkByPosition(senderLatLng, receiverLatLng, options){CommunicationLink}

leaflet/mapping/MovingTargetLayer.js, line 348

通过位置点创建通讯链路特效。

Name Type Description
senderLatLng L.LatLng

通讯链路发送信号位置点

receiverLatLng L.LatLng

通讯链路接收信号位置点

options object

通讯链路参数

Name Type Description
dashSpeed number 可选

通讯链路移动速度。

style Object 可选

通讯链路样式。

Name Type Description
weight number 可选

通讯链路线宽。

movePathColor string 可选

通讯链路移动线路颜色。

movePathOpacity number 可选

通讯链路移动线路透明度。

dashArray string 可选

通讯链路短线与间隔的长度。

staticPathColor string 可选

通讯链路静态线路颜色。

staticPathOpacity number 可选

通讯链路静态线路透明度。

Returns:
Type Description
CommunicationLink 通讯链路对象

createDestroy(associatedUuid, options){Destroy}

leaflet/mapping/MovingTargetLayer.js, line 373

通过标号关联id创建摧毁特效。

Name Type Description
associatedUuid string

关联标号id

options object

摧毁参数

opotions.durationTime string 可选

摧毁持续时间。

Returns:
Type Description
Destroy 摧毁对象

createLineRelation(startAssociatedUuid, endAssociatedUuid, lineRelationType, uuid, style, options, custom){LineRelation}

leaflet/mapping/MovingTargetLayer.js, line 2491

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

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

用户的自定义属性。

Returns:
Type Description
LineRelation
  • 连接线

createSectorDetectionRange(associatedUuid, options){SectorDetectionRange}

leaflet/mapping/MovingTargetLayer.js, line 499

通过标号关联id创建扇形扫描特效。

Name Type Description
associatedUuid string

关联标号id

options object

扇形扫描参数

Name Type Description
angle string 可选

扇形开合角度

scanAngle string 可选

扫描瓣开合角度

radius number 可选

扇形扫描半径

radiusUnit boolean 可选

扇形半径单位类型(默认为像素)。

style Object 可选

扇形风格参数。

Name Type Description
fillColor string 可选

扇形填充色。

fillOpacity string 可选

扇形填充透明度。

opacity number 可选

扇形边界透明度。

color number 可选

扇形边界颜色。

scanStyle Object 可选

扫描风格参数。

Name Type Description
fillColor string 可选

扫描填充色。

fillOpacity string 可选

扇形扫描填充透明度。

color number 可选

扇形扫描边界颜色。

opacity number 可选

扇形扫描边界透明度。

Returns:
Type Description
SectorDetectionRange 扇形扫描对象

createSectorDetectionRangeByPosition(latlng, options){SectorDetectionRange}

leaflet/mapping/MovingTargetLayer.js, line 529

通过位置点创建扇形扫描特效。

Name Type Description
latlng L.LatLng

扇形扫描位置点

options object

扇形扫描参数

Name Type Description
angle string 可选

扇形开合角度

scanAngle string 可选

扫描瓣开合角度

radius number 可选

扇形扫描半径

radiusUnit boolean 可选

扇形半径单位类型(默认为像素)。

style Object 可选

扇形风格参数。

Name Type Description
fillColor string 可选

扇形填充色。

fillOpacity string 可选

扇形填充透明度。

opacity number 可选

扇形边界透明度。

color number 可选

扇形边界颜色。

scanStyle Object 可选

扫描风格参数。

Name Type Description
fillColor string 可选

扫描填充色。

fillOpacity string 可选

扇形扫描填充透明度。

color number 可选

扇形扫描边界颜色。

opacity number 可选

扇形扫描边界透明度。

Returns:
Type Description
SectorDetectionRange 扇形扫描对象

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

leaflet/mapping/MovingTargetLayer.js, line 2269

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

Name Type Description
libID number

标号库ID。

code number

标号代码。

latlngs Array.<L.LatLng>

标号位置点。

uuid string 可选

标号唯一标识。

style style 可选

标号的显示风格。

options Object

指定标号的属性。

Name Type Default Description
serverUrl String 可选

标绘服务地址

symbolData Object 可选

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

symbolSize SuperMap.Size 可选

标号大小。

dRotate number 0 可选

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

symbolRank SymbolRank 0 可选

点标号级别。

horizontalMirror boolean false 可选

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

verticalMirror boolean false 可选

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

space number 7 可选

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

surroundLineType number 可选

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

textContent string 可选

标号注记内容。

textDisplay boolean true 可选

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

annotationPosition AnnoPosition AnnoPosition.TOP 可选

标号的注记位置。

pictureFrames PictureFrame 可选

图片对象。

autoRotation boolean false 可选

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

symbolTexts Array.<SymbolText> [] 可选

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

trajectory Trajectory null 可选

点标号的轨迹线设置

bloodVolumes Array.<BloodVolume> [] 可选

点标号的血条,支持设置多个

detectionRange DetectionRange null 可选

点标号的探测范围,只支持动目标图层显示

callback function 可选

回调函数。

custom Object

用户的自定义属性。

createSymbolGroup(features){array}

leaflet/mapping/MovingTargetLayer.js, line 823

创建标号聚合对象

Name Type Description
features array

需要聚合的标号数组

Returns:
Type Description
array 聚合标号数组

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

leaflet/mapping/MovingTargetLayer.js, line 2442

创建对象标注。

Name Type Description
associatedUuid string

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

symbolText 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/MovingTargetLayer.js, line 2467

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

Name Type Description
associatedUuid string

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

textContents Array.<string>

文字内容的数组。

uuid string

实体的唯一标识。

style style

指定标号的样式。

options Object

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

custom Object

用户的自定义属性。

geoJsonToFeature(geoJson, callback)

leaflet/mapping/MovingTargetLayer.js, line 2251

根据 GeoJson 串返回标绘对象。

Name Type Description
geoJson string

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

callback function 可选

回调函数。

getAllSymbolGroups(){array}

leaflet/mapping/MovingTargetLayer.js, line 875

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

Returns:
Type Description
array 聚合对象数组

getEditable(){boolean}

leaflet/mapping/MovingTargetLayer.js, line 614

获取图层的可编辑。

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

getFeatureByUuid(uuid){PlottingObject}

leaflet/mapping/MovingTargetLayer.js, line 1989

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

Name Type Description
uuid string

用户定义的唯一ID。

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

getFeatures()

leaflet/mapping/MovingTargetLayer.js, line 2029

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

getFeaturesInBounds()

leaflet/mapping/MovingTargetLayer.js, line 2662

获取屏幕范围内的对象。

getLocked(){boolean}

leaflet/mapping/MovingTargetLayer.js, line 640

获取图层的可锁定。

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

getSelected(){boolean}

leaflet/mapping/MovingTargetLayer.js, line 583

获取图层的可选择。

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

getSpecialEffectObject(uuid){Aim|SectorDetectionRange|Boom|CommunicationLink|Destroy}

leaflet/mapping/MovingTargetLayer.js, line 569

获取指定特效。

Name Type Description
uuid string

特效唯一标识符

Returns:
Type Description
Aim | SectorDetectionRange | Boom | CommunicationLink | Destroy 特效对象

getVisibility(){boolean}

leaflet/mapping/MovingTargetLayer.js, line 666

获取图层的可见性。

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

redraw()

leaflet/mapping/MovingTargetLayer.js, line 2569

不更新数据重绘图层的所有对象

removeAllFeatures()

leaflet/mapping/MovingTargetLayer.js, line 2221

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

removeFeatures(features)

leaflet/mapping/MovingTargetLayer.js, line 2135

从当前图层中删除feature。这个函数擦除所有传递进来的矢量要素。

Name Type Description
features Array.<PlottingObject>

要删除feature的数组

removeSpecialEffect(uuid)

leaflet/mapping/MovingTargetLayer.js, line 559

移除指定特效。

Name Type Description
uuid string

特效唯一标识符

setClusterInfoVisible(visible)

leaflet/mapping/MovingTargetLayer.js, line 1390

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

Name Type Description
visible boolean

是否显示

setClusterRangeVisible(visible)

leaflet/mapping/MovingTargetLayer.js, line 1373

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

Name Type Description
visible boolean

是否显示

setClusterStyle(style)

leaflet/mapping/MovingTargetLayer.js, line 1408

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

Name Type Description
style object

样式风格

Name Type Description
rangeColor string 可选

聚合范围颜色

fontBackgroundColor string 可选

聚合信息背景色

fontBackgroundBorderColor string 可选

聚合信息背景边框色

setEditable(isEditable)

leaflet/mapping/MovingTargetLayer.js, line 623

设置图层的可编辑。

Name Type Description
isEditable boolean

图层是否可编辑。

setGraphicZIndex(zIndex)

leaflet/mapping/MovingTargetLayer.js, line 1734

设置栅格对象renderer的z-index。

Name Type Description
zIndex number

栅格对象renderer的z-index。

setLocked(isLocked)

leaflet/mapping/MovingTargetLayer.js, line 649

设置图层的可锁定。

Name Type Description
isLocked boolean

图层的锁定。

setSelected(isSelected)

leaflet/mapping/MovingTargetLayer.js, line 592

设置图层的可选择。

Name Type Description
isSelected boolean

图层是否可选择。

setSymbolCluster(isCluster)

leaflet/mapping/MovingTargetLayer.js, line 1011

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

Name Type Description
isCluster boolean

是否聚合。

setUnitSize(unitSize)

leaflet/mapping/MovingTargetLayer.js, line 1122

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

Name Type Description
unitSize object

聚合策略的分块大小

Name Type Description
width number 可选

块宽度-经纬度为单位

height number 可选

块高度-经纬度为单位

setVectorZIndex(zIndex)

leaflet/mapping/MovingTargetLayer.js, line 1746

设置矢量对象renderer的z-index。

Name Type Description
zIndex number

矢量对象renderer的z-index。

setVisibility(visibility)

leaflet/mapping/MovingTargetLayer.js, line 675

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

Name Type Description
visibility boolean

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

unClusterSymbol(symbolGroup)

leaflet/mapping/MovingTargetLayer.js, line 855

解绑标号聚合对象

Name Type Description
symbolGroup array

聚合标号

update()

leaflet/mapping/MovingTargetLayer.js, line 2550

不更新数据重绘图层的所有栅格对象。

updateFeatures(features)

leaflet/mapping/MovingTargetLayer.js, line 2519

更新指定栅格对象并重绘,矢量对象可以直接使用feature.redraw()重绘就可以

Name Type Description
features Object

动目标对象。