Class: CommunicationLink

CommunicationLink

通讯链路特效,分为两类,第一类通过标号uuid进行创建与标号绑定的特效,由标号内部管理,直接创建后可以通过DotSymbol#getSpecialEffects进行获取;第二类可以通过位置点创建,由特效管理器进行管理, 可以直接创建后使用SpecialEffectManager#addSpecialEffect接口加入管理器进行管理,也可以通过SpecialEffectManager#createCommunicationLinkByPosition创建,还可以通过MovingTargetLayer#createCommunicationLinkByPosition创建。

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.CommunicationLink(senderUuid, receiverUuid, senderLatLng, receiverLatLng, options);
  
  // 另一种写法
  L.supermap.plotting.communicationLink(senderUuid, receiverUuid, senderLatLng, receiverLatLng, options);

  
</script>

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

new CommunicationLink(senderUuid, receiverUuid, senderLatLng, receiverLatLng, options);

leaflet/specialeffect/CommunicationLink.js, line 100
Name Type Description
senderUuid string

通讯链路发送信号关联的标号uuid, 与位置点数组二选一传入

receiverUuid string

通讯链路接收信号关联的标号uuid, 与位置点数组二选一传入

senderLatLng L.LatLng

通讯链路发送位置点 与关联标号uuid二选一传入

receiverLatLng L.LatLng

通讯链路接收位置点 与关联标号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 可选

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

Version:
  • 11.2.0
Example
//方式一,创建与标号绑定的特效,由标号内部进行管理
  var communicationLink = L.supermap.plotting.communicationLink(senderUuid, receiverUuid, null, null, options);

  //方式二, 使用管理器创建
  var specialEffectManager = L.supermap.plotting.getControl().getSpecialEffectManager();
  var communicationLink = specialEffectManager.createCommunicationLinkByPosition(senderPosition, receiverPosition, options);

  //方式三, 在动目标图层上使用接口创建
  var movingTargetLayer = L.supermap.plotting.movingTargetLayer("movingTarget", serverUrl);;
  var communicationLink = movingTargetLayer.createCommunicationLinkByPosition(senderPosition, receiverPosition, options);

Extends

Members

dashSpeednumber

移动速度

namestring

特效名称。

receiverUuidstring

通讯链路瞄准点关联标号的id。

senderUuidstring

通讯链路观察点关联标号的id。

styleobject

通讯链路样式参数

Methods

getPosition()

leaflet/specialeffect/CommunicationLink.js, line 351

获取关联位置点坐标

inherited getType(){SpecialEffectType}

leaflet/specialeffect/BaseEffect.js, line 79

获取特效类型

Returns:
Type Description
SpecialEffectType 返回特效类型

inherited getUuid(){string}

leaflet/specialeffect/BaseEffect.js, line 69

获取特效唯一标识符

Returns:
Type Description
string 特效uuid

pause()

leaflet/specialeffect/CommunicationLink.js, line 306

暂停通讯链路

play()

leaflet/specialeffect/CommunicationLink.js, line 296

播放通讯链路

remove()

leaflet/specialeffect/CommunicationLink.js, line 316

摧毁通讯链路特效

setDashSpeed(dashSpeed)

leaflet/specialeffect/CommunicationLink.js, line 360

设置通讯链路移动速度

Name Type Description
dashSpeed number

移动速度

setName(name)

leaflet/specialeffect/CommunicationLink.js, line 375

设置特效名称

Name Type Description
name string

特效名称

setStyle(style)

leaflet/specialeffect/CommunicationLink.js, line 415

设置通讯链路样式

Name Type Description
style object

修改的属性对象

Name Type Description
weight string 可选

通讯链路线宽

dashArray string 可选

通讯链路虚线间隔长短

movePathColor string 可选

通讯链路动态线颜色

movePathOpacity number 可选

通讯链路动态线透明度

staticPathColor string 可选

通讯链路静态线颜色

staticPathOpacity number 可选

通讯链路静态线透明度

setVisible(visible)

leaflet/specialeffect/CommunicationLink.js, line 385

设置显隐

Name Type Description
visible boolean

是否显示