Class: DotSymbol

DotSymbol

点标号, 通过PlottingLayer#createSymbolPlottingObject#createSymbol接口进行创建,前者直接加入plottingLayer中进行管理,后者创建完成后需要通过PlottingLayer#addFeatures接口添加到图层中进行管理。

new DotSymbol(libID, code, latlngs, options)

leaflet/layer/DotSymbol.js, line 10
Name Type Description
libID number

标号的ID。

code number

标号的code。

latlngs Array.<L.LatLng>

标号位置点。

options Object

标号参数。

Name Type Default Description
uuid string 可选

标号的唯一标识符。

serverUrl String 可选

标绘服务地址

symbolData Object 可选

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

symbolSize SuperMap.Size 可选

标号大小。

positionOffset boolean false 可选

位置点偏移。

positionOffsetType PositionOffsetType PositionOffsetType.LINE 可选

偏移线类型。

positionOffsetX number 可选

点标号X方向偏移量。

positionOffsetY number 可选

点标号Y方向偏移量。

symbolRank SymbolRank 0 可选

点标号级别。

negativeImage boolean false 可选

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

horizontalMirror boolean false 可选

是否启用水平镜像。

verticalMirror boolean false 可选

是否启用竖直镜像。

maxScale number 5 可选

标号最大缩放比例。

minScale number 1 可选

标号最小缩放比例。

space number 7 可选

注记与标号的距离。

dRotate number 0 可选

标号的旋转角度。

textContent string 可选

标号的注记内容。

textDisplay boolean true 可选

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

annotationPosition AnnoPosition AnnoPosition.TOP 可选

标号的注记位置。

surroundLineType number 可选

衬线类型。

scaleByMap boolean false 可选

标号是否随图缩放。

enableEdit boolean true 可选

标号是否可编辑。

isLocked boolean false 可选

标号是否被锁定。

symbolTexts Array.<SymbolText> [] 可选

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

specialEffects Array.<Aim> | Array.<Boom> | Array.<CommunicationLink> | Array.<Destroy> | Array.<ScanRadar> | Array.<SectorDetectionRange> | Array.<MonitoringRadar> [] 可选

点标号的特效,支持设置多个

bloodVolumes Array.<BloodVolume> [] 可选

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

pictureFrames Array.<PictureFrame> [] 可选

点标号的自定义图片,支持设置多个

trajectory Trajectory null 可选

点标号的轨迹线设置,只支持动目标图层显示

detectionRange DetectionRange null 可选

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

autoRotation boolean false 可选

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

avoidRegions Array.<AvoidRegion> 可选

标号的避让区域。

extendProperty Array.<ExtendProperty> 可选

标号的自定义属性。

note string 可选

标号的备注。

custom object 可选

用来存储用户的自定义数据。

style style 可选

标号的显示风格。

innerTextContent string 可选

点标号的内部注记,仅部分点标号支持。

innerTextStyle innerTextStyle 可选

点标号的内部注记样式,仅部分点标号支持。

symbolAnnotations Array.<SymbolAnnotation> [] 可选

标号的多注记数组。

Example
var plottingLayer = L.supermap.plotting.plottingLayer("plot", serverUrl).addTo(window.map);
  plottingLayer.createSymbol(421,30101,[L.latLng(32,101)],{symbolType:SuperMap.Plot.SymbolType.DOTSYMBOL},function(evt){},{});

Extends

Methods

inherited addLatLng(latlng)

leaflet/layer/GraphicObject.js, line 170

增加标号的位置点。

Name Type Description
latlng L.LatLng

标号的位置点。

inherited bilnk(options)

leaflet/layer/GraphicObject.js, line 241

标号闪烁,默认闪烁5次,闪烁5秒。

Name Type Description
options object

可以不传。

Name Type Description
blinkNumber number

闪烁次数

duration number

闪烁时长

leaflet/layer/GraphicObject.js, line 280

取消标号闪烁

inherited canSetInnerText(){boolean}

leaflet/layer/GraphicObject.js, line 329

线面标号是否可以设置中间横线注记。

Returns:
Type Description
boolean 返回是否可以设置中间横线注记。

destroy()

leaflet/layer/DotSymbol.js, line 399

销毁几何图形。

getBloodVolumes(){Array.<BloodVolume>}

leaflet/layer/DotSymbol.js, line 1697

获取血量值对象数组。

Returns:
Type Description
Array.<BloodVolume> 返回血量值对象数组,修改后需要调用redraw重绘。

getBounds(){L.LatLngBounds}

leaflet/layer/DotSymbol.js, line 1932

获得几何图形的边界。如果没有设置边界,可通过计算获得。

Returns:
Type Description
L.LatLngBounds 几何对象的边界。

getBoundsWithText(){L.LatLngBounds}

leaflet/layer/DotSymbol.js, line 1966

获得几何图形的边界(包括注记)。

Returns:
Type Description
L.LatLngBounds 几何对象的边界。

getHorizontalMirror(){boolean}

leaflet/layer/DotSymbol.js, line 1621

获取图形对象的水平镜像(只对点标号有效)。

Returns:
Type Description
boolean 图形对象的水平镜像。

getInnerTextContent()

leaflet/layer/DotSymbol.js, line 1171

获取内部注记内容。

getInnerTextStyle()

leaflet/layer/DotSymbol.js, line 1194

获取内部注记样式。

inherited getLatLngs(){Array.<L.LatLng>}

leaflet/layer/GraphicObject.js, line 160

获取标号位置点。

Returns:
Type Description
Array.<L.LatLng> 标号的位置点。

getNegativeImage(){boolean}

leaflet/layer/DotSymbol.js, line 1578

获取图形对象的镜像(只对点标号有效)。

Returns:
Type Description
boolean 图形对象的镜像。

getPictureFrames(){Array.<PictureFrame>}

leaflet/layer/DotSymbol.js, line 1786

获取自定义图片对象数组。

Returns:
Type Description
Array.<PictureFrame> 返回自定义图片对象数组,修改后需要调用redraw重绘。

inherited getPolylineCellBufferGradientParameter(){Object}

leaflet/layer/GraphicObject.js, line 125

获取折线图元缓冲渐变参数,详细参数见:setPolylineCellBufferGradientParameter。

Returns:
Type Description
Object 缓冲渐变参数。

getPositionOffset(){boolean}

leaflet/layer/DotSymbol.js, line 1115

获取位置是否偏移。

Returns:
Type Description
boolean 返回位置是否偏移。

getPositionOffsetType(){PositionOffsetType}

leaflet/layer/DotSymbol.js, line 1139

获取位置偏移类型。

Returns:
Type Description
PositionOffsetType 返回位置偏移类型。

getScale(){number}

leaflet/layer/DotSymbol.js, line 1041

获取点标号的缩放比例。

Returns:
Type Description
number 返回点标号的缩放比例。

inherited getScaleByMap(){boolean}

leaflet/layer/GraphicObject.js, line 192

获取点标号是否随图缩放。

Returns:
Type Description
boolean 返回点标号是否随图缩放。

getSpace(){number}

leaflet/layer/DotSymbol.js, line 979

获取文字与标号的距离。

Returns:
Type Description
number 返回文字与标号的距离。

getSpecialEffects(){Array.<(Aim|Boom|CommunicationLink|Destroy|ScanRadar|SectorDetectionRange|MonitoringRadar)>}

leaflet/layer/DotSymbol.js, line 1715

获取当前标号下的特效对象数组。

Returns:
Type Description
Array.<(Aim|Boom|CommunicationLink|Destroy|ScanRadar|SectorDetectionRange|MonitoringRadar)> 返回特效对象数组,修改后需要调用redraw重绘。

inherited getSurroundLineType(){number}

leaflet/layer/GraphicObject.js, line 201

获取标号的衬线类型。

Returns:
Type Description
number 标号的衬线类型。

getSymbolRank(){number}

leaflet/layer/DotSymbol.js, line 1414

获取标号的符号等级。

Returns:
Type Description
number 返回标号的符号等级。

getSymbolRanks(){Array.<number>}

leaflet/layer/DotSymbol.js, line 1405

获取标号的符号等级列表。

Returns:
Type Description
Array.<number> 返回标号的符号等级列表。

getSymbolSize(){SuperMap.Size}

leaflet/layer/DotSymbol.js, line 1262

获取点标号的大小。

Returns:
Type Description
SuperMap.Size 返回点标号的大小。

getSymbolTexts(){Array.<SymbolText>}

leaflet/layer/DotSymbol.js, line 1706

获取标牌对象数组。

Returns:
Type Description
Array.<SymbolText> 返回标牌对象数组,修改后需要调用redraw重绘。

getSymbolTextStyle(){Object}

leaflet/layer/DotSymbol.js, line 3417

获取标牌标题样式

Returns:
Type Description
Object 标牌样式(object详见setSymbolTextStyle()接口)

getVerticalMirror(){boolean}

leaflet/layer/DotSymbol.js, line 1644

获取图形对象的竖直镜像(只对点标号有效)。

Returns:
Type Description
boolean 图形对象的竖直镜像。

getWidthHeightLimit(){boolean}

leaflet/layer/DotSymbol.js, line 1688

获取宽高限定。

Returns:
Type Description
boolean 返回宽高是否限定。

inherited isShowPolylineCellBufferGradient(){boolean}

leaflet/layer/GraphicObject.js, line 86

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

Returns:
Type Description
boolean 否显示缓冲渐变。

middleMarkExist(){boolean}

leaflet/layer/DotSymbol.js, line 1224

是否可设置中间注记。

Returns:
Type Description
boolean 返回是否可设置中间注记。

move(lat, lng)

leaflet/layer/DotSymbol.js, line 1830

沿着x、y轴的正方向上按照给定的位移移动几何图形,move 不仅改变了几何图形的位置并且清理了边界缓存。

Name Type Description
lat number

y轴正方向上移动的距离。

lng number

x轴正方向上移动的距离。

removeSpecialEffect(specialEffect)

leaflet/layer/DotSymbol.js, line 1767

移除特效。

Name Type Description
specialEffect Aim | Boom | CommunicationLink | Destroy | ScanRadar | SectorDetectionRange | MonitoringRadar

特效对象。

removeSpecialEffect(specialEffect)

leaflet/layer/Picture.js, line 189

移除特效。

Name Type Description
specialEffect Aim | Boom | CommunicationLink | Destroy | ScanRadar | SectorDetectionRange

特效对象。

removeSymbolText(index)

leaflet/layer/DotSymbol.js, line 3452

移除标牌。

Name Type Description
index number

标牌索引,如果不输入则移除所有标牌

removeSymbolText(index)

leaflet/layer/Picture.js, line 765

移除标牌。

Name Type Description
index number

标牌索引,如果不输入则移除所有标牌

setDotSubSymbol(libID, code, lineColor, width2D)

leaflet/layer/DotSymbol.js, line 1506

设置标号的符号等级。

Name Type Description
libID number

子标号的库ID。

code number

子标号code。

lineColor number

子标号线色

width2D number

子标号线宽

setHorizontalMirror(mirror)

leaflet/layer/DotSymbol.js, line 1630

设置图形对象的水平镜像(只对点标号有效)。

Name Type Description
mirror boolean

图形对象的水平镜像。

setInnerTextContent(content)

leaflet/layer/DotSymbol.js, line 1180

设置内部注记内容。

Name Type Description
content string

注记内容。

setInnerTextStyle(style)

leaflet/layer/DotSymbol.js, line 1203

设置内部注记样式。

Name Type Description
style Object

内部注记样式

inherited setLatLngs(latlngs)

leaflet/layer/GraphicObject.js, line 145

设置标号位置点。

Name Type Description
latlngs Array.<L.LatLng>

标号的位置点。

setNegativeImage(mirror)

leaflet/layer/DotSymbol.js, line 1587

设置图形对象的镜像(只对点标号有效)。

Name Type Description
mirror boolean

图形对象的镜像。

inherited setPolylineCellBufferGradientParameter(parameter)

leaflet/layer/GraphicObject.js, line 95

设置折线图元缓冲渐变参数。

Name Type Description
parameter Object

折线图元缓冲渐变参数。

Name Type Description
startColor String

渐变开始颜色,默认值为:"rgba(255, 0, 0, 1)"

endColor String

渐变结束颜色,默认值为:"rgba(255, 0, 0, 0)"

bufferWidth Number

渐变宽度,默认值为:10,单位:毫米,最大生效值:30

isBufferLeft boolean

是否为左侧渐变,默认值为true

setPositionOffset(positionOffset)

leaflet/layer/DotSymbol.js, line 1096

设置位置是否偏移。

Name Type Description
positionOffset boolean

位置是否偏移。

setPositionOffsetType(positionOffsetType)

leaflet/layer/DotSymbol.js, line 1124

设置位置偏移类型。

Name Type Description
positionOffsetType PositionOffsetType

位置偏移类型。

setRotate(rotateValue)

leaflet/layer/DotSymbol.js, line 1011

设置点标号的旋转角度。

Name Type Description
rotateValue number

点标号的旋转角度。

setScale(scaleValue)

leaflet/layer/DotSymbol.js, line 1057

设置点标号的比例值。

Name Type Description
scaleValue number

点标号的比例值。

inherited setScaleByMap(isScaleByMap)

leaflet/layer/GraphicObject.js, line 182

设置点标号是否随图缩放。

Name Type Description
isScaleByMap boolean

点标号是否随图缩放。

inherited setShowPolylineBufferGradient(showPolylineCellBufferGradient)

leaflet/layer/GraphicObject.js, line 74

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

Name Type Description
showPolylineCellBufferGradient boolean

是否显示缓冲渐变。

setSpace(space)

leaflet/layer/DotSymbol.js, line 988

设置文字与标号的距离。

Name Type Description
space number

文字与标号的距离。

setSurroundLineType(surroundLineType)

leaflet/layer/DotSymbol.js, line 1351

设置标号的衬线类型。

Name Type Description
surroundLineType number

标号的衬线类型,点标号有两种类型:0无衬线,1有衬线。

setSymbolRank(rank)

leaflet/layer/DotSymbol.js, line 1423

设置标号的符号等级。

Name Type Description
rank number

符号等级。0: 无级别,1: 军区级,2: 副大军区级,3: 集团军级,4: 师级,5: 旅级,6: 团级,7: 营级,8: 连级,9: 排级。

setSymbolSize(width, height)

leaflet/layer/DotSymbol.js, line 1271

设置点标号的大小。

Name Type Description
width number

点标号的宽度。

height number

点标号的高度。

setSymbolText(symbolText, index)

leaflet/layer/DotSymbol.js, line 3429

设置标牌

Name Type Description
symbolText Object

标牌对象

index number

标牌对象索引

setSymbolTextStyle(option)

leaflet/layer/DotSymbol.js, line 3227

设置标牌样式,(signMode == SignMode.Simple || signMode == SignMode.Complex)时生效

Name Type Description
option Object

标牌所有样式

Name Type Description
templateUrl Object

标牌模板资源路径,当signMode == Custom 时生效

dom Object

标牌div字符串,当signMode == Custom 时生效

signType Object

标牌类型(15种枚举),(signMode == SignMode.Simple || signMode == SignMode.Complex)时生效

signRenderMode Object

标牌渲染方式(Billboard和DOM两种,DOM模式目前待开发)

signMode Object

标牌参数模式(Simple、Complex、Custom、Image四种枚举)

texts Object

标牌内容(例:["内容1:内容","内容2:内容"])

title Object

标牌标题(例:["标题"])

signImage Object

标牌参数模式是Image时候使用,传入的标牌内容为图片

scale Object

标牌缩放比例

offset Object

标牌偏移量(例:offset:{x:10,y:10})

titleStyle Object

标牌标题样式,(signMode == SignMode.Simple || signMode == SignMode.Complex)时生效

Name Type Description
color string

文字颜色(例:["rgba(58, 6, 0, 1)"])

fontFamily string

字体系列

fontStyle string

字体样式(例:1.默认值:normal(正常) 2.italic(倾斜))

fontSize string

字体大小(单位:mm)

fontWeight string

字体粗细(例:1.关键字normal(正常)bold(加粗) 2.纯数字100-900的整百数 400(正常) 700加粗)

titleFrameStyle Object

标牌标题框样式,(signMode == SignMode.Simple || signMode == SignMode.Complex)时生效

Name Type Description
lineWidth number

线宽(mm)

lineColor Array.<string>

线色(例:["rgba(58, 6, 0, 1)"])

lineColorGradientType ColorGradientType

颜色渐变类型(例:ColorGradientType.Horizontal 横向渐变)

lineDash number

虚线间隔(例:10 mm)

backgroundColor Array.<string>

背景色(例:["rgba(58, 6, 0, 1)"])

backgroundColorGradientType ColorGradientType

颜色渐变类型(例:ColorGradientType.Horizontal 横向渐变)

arcCorner boolean

是否圆角(boolean)

imagePath string

背景图片(例:"http://localhost:8090/iserver/mgis/situationSimulation/Sign/科技.png")

textStyle Object

标牌内容文本样式,(signMode == SignMode.Simple || signMode == SignMode.Complex)时生效

Name Type Description
color string

文字颜色(例:["rgba(58, 6, 0, 1)"])

fontFamily string

字体系列

fontStyle string

字体样式(例:1.默认值:normal(正常) 2.italic(倾斜))

fontSize string

字体大小(单位:mm)

fontWeight string

字体粗细(例:1.关键字normal(正常)bold(加粗) 2.纯数字100-900的整百数 400(正常) 700加粗)

textIndex number

标牌内容指定行索引,如果未设置默认为所有内容样式

textStyles Array

文本样式数组(文本样式数组需与文本数组一一对应)

indecatorLineStyle Object

牵引线样式

Name Type Description
lineWidth number

线宽(mm)

lineColor string

线色(例:"#ffff00" )

lineSymbolID number

线型(0为实线,1为虚线)

opacity number

线透明度(值为0-1的小数)

trayStyle Object

标牌托盘样式,(signMode == SignMode.Simple || signMode == SignMode.Complex)时生效

Name Type Description
visible boolean

是否显示

lineWidth number

线宽(mm)

lineColor Array.<string>

线色(例:["rgba(58, 6, 0, 1)"])

lineDash number

虚线间隔(例:10 mm)

contentFrameStyle Object

标牌内容框样式,(signMode == SignMode.Simple || signMode == SignMode.Complex)时生效

Name Type Description
lineWidth number

线宽(mm)

lineColor Array.<string>

线色(例:["rgba(58, 6, 0, 1)"])

lineColorGradientType ColorGradientType

颜色渐变类型(例:ColorGradientType.Horizontal 横向渐变)

lineDash number

虚线间隔(例:10mm)

backgroundColor Array.<string>

背景色(例例:["rgba(58, 6, 0, 1)"])

backgroundColorGradientType ColorGradientType

颜色渐变类型(例:ColorGradientType.Horizontal 横向渐变)

arcCorner boolean

是否圆角(boolean)

imagePath string

背景图片(例:"http://localhost:8090/iserver/mgis/situationSimulation/Sign/科技.png")

iconStyle Object

兼容二维原有标牌图片样式,(signType == null)时生效

Name Type Description
path boolean

图标路径

width number

图标宽度

height number

图标高度

position number

图标左右枚举

setSymbolTextVisible(visible, index)

leaflet/layer/DotSymbol.js, line 1795

设置标牌的可见性。

Name Type Description
visible boolean

标牌是否可见boolean

index number

标牌索引,如果不输入则设置所有标牌

setTextContent(content)

leaflet/layer/DotSymbol.js, line 1148

设置注记内容。

Name Type Description
content string

注记内容。

setTextPosition(textPoistion)

leaflet/layer/DotSymbol.js, line 1233

设置注记文本位置。

Name Type Description
textPoistion Object

注记文本的位置。

setVerticalMirror(mirror)

leaflet/layer/DotSymbol.js, line 1653

设置图形对象的竖直镜像(只对点标号有效)。

Name Type Description
mirror boolean

图形对象的竖直镜像。

setWidthHeightLimit()

leaflet/layer/DotSymbol.js, line 1667

设置宽高限定

Type Description
boolean

widthHeightLimit 宽高是否限定