Sign

Signage, inherited fromPlotGeoEffectBase

The relevant instructions are as follows:

1 Signage supports three modes of construction: parameters, DOM elements (html templates or DOM strings), and images (paths or image resources), see the SignParmMode class.

1.1 The design logic for the parameter-based signage construction mode is: assuming that any signage consists of three parts - a title area, a content area, and a footer - users can build the object by setting relevant parameters for these three parts.

1.1.1 In the parameter-based signage construction, the title area consists of [title text (title), title text style (titleStyle), and title frame style (TitleFrameStyle)].

1.1.2 In the parameter-based signage construction, the content area consists of [multi-line text (texts), multi-line text style (textsStyle), and content frame style (contentFrameStyle)].

1.1.3 In the parameter-based signage construction, the footer's style can be set through a relevant interface.

1.2 The parameter-based signage construction mode typically involves first creating a signage object through a signage enumeration (SignEffectType), and then modifying the parameters of each part of the signage through relevant interfaces.

2 In the DOM element-based signage construction mode, users are supported to input DOM strings or corresponding HTML templates.

2.1 mServer provides relevant HTML templates, which can be found in the following path: under the \webapps\iserver\mgis\situationSimulation\Sign folder in the mServer package.

3 The signage supports rendering through three modes: Billboard object (billboard), DOM element (DOM), and 3D object (Solid).

3.1 Billboard rendering, which always faces the screen in real-time, has the advantages of high performance, low resource consumption, and minimal impact on scene rendering frame rates, commonly used when adding a large number of signs; however, it has the disadvantage of not supporting real-time updates of data on the sign and not providing as good rendering effects as DOM.

3.2 DOM rendering, which also faces the screen in real-time, has the advantages of excellent rendering effects and supporting real-time updates of data on the sign. However, it has the disadvantages of high resource consumption and the potential to impact scene rendering frame rates when a large number of signs are added. Additionally, in this mode, DOM objects may block the ball operation.

3.3 Solid rendering involves converting the signage object into a 3D model object, therefore it does not face the screen in real-time. When not bound to a plotting object, it follows the right-hand coordinate system, with the positive direction of the Y-axis pointing towards the North Pole by default. It is commonly used for binding to plotting objects (in model mode).

4 Solid signage (Solid rendering) does not support signage avoidance.

new SuperMap3D.Sign(options)

Name Type Description
options Object optional Object with the following properties:
Name Type Default Description
isUsePlotVisible Boolean true optional Whether it is affected by the visibility of the plotting object
visible Boolean true optional Whether to show
geoGraphicObject GeoGraphicObject optional Set the symbol of the binding
position MPoint3D optional Set the effect location, if not set, get it from the symbol first. If the symbol is not bound, you need to update the location point through the updateEffect (options) interface.
texts Array.<String> ["This is a sign"] optional Array of signage text information
title String "Title" optional Signage title information
signParmMode SignParmMode SignParmMode.Parameter optional Signage creation mode, parameter creation:SignParmMode. Parameter (can set texts, title), custom creation: SignParmMode. Custom (can set texts, templateUrl or dom), Image creation:SignParmMode. Image (can set image)
signEffectType SignEffectType SignEffectType.Sign1 optional Default Style Type of Parameterized Signage
showIndecatorLine boolean true optional Does the signage show a traction line?
pntOffset3D MPoint3D new SuperMap3D.MPoint3D() optional Signage Offset of Dot symbol in Model mode
pntOffset2D MPoint3D new SuperMap3D.MPoint3D() optional Signage Offset of Dot symbol in Bulletin board mode and picture mode
dom String "" optional Custom signage div
signRenderMode SignRenderMode SignRenderMode.Billboard optional Signage rendering mode
templateUrl String "" optional User-defined signage template resource path (signParmMode == SignParmMode. Custom takes effect)
signImage String "" optional Set the Base64 resource string or image path of the signage image (signParmMode == SignParmMode. Image takes effect)
billboardScale Number 1 optional Scaling of 2D Billboard signage. Effective when signRenderMode == SignRenderMode. Billboard
indecatorLineLength Number 8 optional Set the length of the traction line (unit: mm)
indecatorLineRotation Number 90 optional Set the traction line rotation (the angle with the X-axis of the screen as 0 and the counterclockwise direction as positive, unit: degrees)
solidRotation MPoint3D new MPoint3D(0, 0, 0) optional Sets the Rotation of 3D signage. Effective when signRenderMode == SignRenderMode. Solid
solidScale Number 1 optional Sets the scaling of 3D signage. Effective when signRenderMode == SignRenderMode. Solid
disableDepthTestDistance boolean false optional Sets whether the billboard sign has depth detection enabled. Effective when signRenderMode == SignRenderMode. Billboard

Members

billboardScale : Number

Scaling of 2D Billboard signage. Effective when signRenderMode == SignRenderMode. Billboard
Default Value: 1

disableDepthTestDistance : Number

Sets whether the billboard sign has depth detection enabled. Effective when signRenderMode == SignRenderMode. Billboard
Default Value: false

dom : String

Signage dom string, effective when signParmMode == Custom

id : String

Effect id

indecatorLineLength : Number

Set the length of the traction line (unit: mm)
Default Value: 8

indecatorLineRotation : Number

Set/Get the traction line rotation (the angle with the X-axis of the screen as 0 and the counterclockwise direction as positive, unit: degrees)
Default Value: 90

offset2D : MPoint3D

2D Signage Offset (in pixels) takes effect when signRenderMode == SignRenderMode. Billboard or signRenderMode == SignRenderMode. DOM
Default Value: MPoint3D(0,0,0)

offset3D : MPoint3D

3D Signage Offset (Percentage of Model [Plotted] Control Points) takes effect when signRenderMode == SignRenderMode. Solid
Default Value: MPoint3D(0,0,0)

readyPromise : Promise

Signage resources are ready

showIndecatorLine : Boolean

Whether to show traction line
Default Value: true

signEffectType : SignEffectType

Signage type, effective when signParmMode == SignParmMode. Parameter
Default Value: SignEffectType.Sign1

signParmMode : SignParmMode

Signage Creation Mode
Default Value: SignParmMode.Parameter

signRenderMode : SignRenderMode

Set the rendering mode of the signage
Default Value: SignRenderMode.Billboard

solidRotation : MPoint3D

Sets the rotation of the 3D signage. Effective when signRenderMode == SignRenderMode. Solid
Default Value: MPoint3D(0,0,0)

solidScale : Number

Sets the scaling of 3D signage. Effective when signRenderMode == SignRenderMode. Solid
Default Value: 1

templateUrl : String

Signage template resource path. This parameter is valid when signParmMode == Custom

Methods

addClickedEvent(callback)

Add left mouse click event
Name Type Description
callback Sign~callback event, parameter {object: signage object, e: {x: screen x coordinate, y: screen y coordinate}}

addDoubleClickedEvent(callback)

Add left mouse button double click event
Name Type Description
callback Sign~callback event, parameter {object: signage object, e: {x: screen x coordinate, y: screen y coordinate}}

addRightClickedEvent(callback)

Add right-click event
Name Type Description
callback Sign~callback event, parameter {object: signage object, e: {x: screen x coordinate, y: screen y coordinate}}

destroy()

Release resources

fromJSON(jsonObj)

Json object to effect object, note: json object does not contain scene and geoGraphicObject objects, you need to call the corresponding interface settings (not completed)
Name Type Description
jsonObj Object json object

getContentFrameStyle()Object

Get the signage content box style
Returns:
Signage content box style (object see setContentFrameStyle() interface)

getIndecatorLineStyle()Object

Get the signage traction line style
Returns:
Traction line style (setIndecatorLineStyle() interface)

getSignImage()

Get the Base64 resource string or image path of the signage image

getTexts()Array.<String>

Get an array of signage text
Returns:
Text array

getTextStyles()Array

Get an array of signage text styles
Returns:
Array of text styles (for object objects, see: setTextStyles () interface)

getTitle()String

Get the sign title
Returns:
Signage title

getTitleFrameStyle()Object

Get the signage title box style
Returns:
Signage title box style (see setTitleFrameStyle () interface for object details)

getTitleStyle()Object

Get the signage title style
Returns:
Signage title style (see setTitleStyle () interface for object details)

getTrayStyle()Object

Get the signage tray style
Returns:
Signage tray style (setTrayStyle () interface)

removeClickedEvent(callback)

Remove the left mouse click event
Name Type Description
callback Sign~callback Callback event

removeDoubleClickedEvent(callback)

Remove the left mouse button double click event
Name Type Description
callback Sign~callback Callback event

removeRightClickedEvent(callback)

Remove the right-click event
Name Type Description
callback Sign~callback Callback event

setContentFrameStyle(contentFrameStyle)

Set the signage content box style, (signParmMode == SignParmMode. Parameter) takes effect
Name Type Description
contentFrameStyle Object signage content box style
Name Type Description
visible Boolean Whether to display
lineWidth Number Line width(mm)
lineColor Array.<Color> Line color(example:[Cesium.Color(1, 0, 0, 1)])
lineColorGradientType ColorGradientType Color Gradient Type (example:ColorGradientType.Horizontal Horizontal Gradient)
lineDash Number dashed line interval (example: 10mm)
backgroundColor Array.<Color> background color (example: [Cesium. Color (1,0,0,0.4) ])
backgroundColorGradientType ColorGradientType Background Color Gradient Type (Example:ColorGradientType.Horizontal Horizontal Gradient)
arcCorner Boolean Whether rounded (boolean)
imagePath String Background image (example: "http://localhost:8090/iserver/mgis/situationSimulation/Sign/technology.png")

setIndecatorLineStyle(indecatorLineStyle)

Set Signage Traction Line Style
Name Type Description
indecatorLineStyle Object Traction Line Style
Name Type Description
lineWidth Number Line width(mm)
aryLineColors Array.<Color> Line color(Example:[MGIS_SuperMap3D.Color(255, 0, 0, 1)])

setSignImage(signImage)

Set the Base64 resource string or image path of the signage image (signParmMode == 2 takes effect)
Name Type Description
signImage String Base64 resource string or image path for the signage image

setTexts(texts)

Set signage text array
Name Type Description
texts Array.<String> Text Array

setTextStyle(textStyle, index)

Set the signage content text style
Name Type Description
textStyle Object Signage content text style
Name Type Description
visible Boolean Whether to display
color Color Text color (example: Cesium. Color (1255,0,0,1))
fontFamily String Font family
fontStyle String Font style (example: 1. Default value: normal (normal) 2.italic (tilt))
fontSize String Font size (unit: mm)
fontWeight String Font thickness (example: 1. Keyword normal (normal) bold (bold) 2. Pure numbers 100-900 integer 400 (normal) 700 bold)
index Number The signage content specifies the row index, if not set, the default is all content styles.

setTextStyles(textStyles, textStyle)

Set the signage text style array (the text style array needs to correspond one-to-one with the text array)
Name Type Description
textStyles Array text style array
textStyle Object Text style to JSON object
Name Type Description
color Color Signage Text Color (Example: Cesium. Color (1,0,0,1))
fontFamily String Signage Text Font Arial | Helvetica |... (Example: "Microsoft YaHei")
fontStyle String Signage Text Style italic | oblique (Example: "normal")
fontSize Number Signage Text Size (Unit: mm)
fontWeight String Signage Text Weight normal | bold | bolder | lighter | 100 | 200 | 300 |... | 900 (Example: "400")

setTitle(title)

Set signage title
Name Type Description
title String Signage title

setTitleFrameStyle(titleFrameStyle)

Set the signage title box style, (signParmMode == SignParmMode. Parameter) takes effect
Name Type Description
titleFrameStyle Object Signage title box style
Name Type Description
visible Boolean Whether to display
lineWidth Number Line width(mm)
lineColor Array.<Color> Line color(Example:[Cesium.Color(1, 0, 0, 1)])
lineColorGradientType ColorGradientType Color Gradient Type(Example:ColorGradientType.Horizontal Horizontal Gradient)
lineDash Number Dashed line interval (example: 10 mm)
backgroundColor Array.<Color> Background color(Example:Cesium.Color(1, 0, 0, 0.4)])
backgroundColorGradientType ColorGradientType Background Color Gradient Type(Example:ColorGradientType.Horizontal Horizontal Gradient)
arcCorner Boolean Whether rounded (boolean)
imagePath String Background image (example: "http://localhost:8090/iserver/mgis/situationSimulation/Sign/technology.png")

setTitleStyle(titleStyle)

Set the signage title style, (signParmMode == SignParmMode. Parameter) takes effect
Name Type Description
titleStyle Object Signage title style
Name Type Description
visible Boolean Whether to display
color Color Text color (example: Cesium. Color (1,0,0,1))
fontFamily String Font family
fontStyle String Font style (example: 1. Default value: normal (normal) 2.italic (tilt))
fontSize String Font size (unit: mm)
fontWeight String Font weight (example: 1. Keyword normal (normal) bold (bold) 2. Pure numbers 100-900 integer 400 (normal) 700 bold)

setTrayStyle(trayStyle)

Set the signage tray style, (signParmMode == SignParmMode. Parameter) takes effect
Name Type Description
trayStyle Object Signage tray style
Name Type Description
visible Boolean Whether to display
lineWidth Number Line width(mm)
lineColor Array.<Color> Line color(Example:[Cesium.Color(1, 0, 0, 1)])
lineDash Number dashed line interval (example: 10 mm)

toJSON()String

Effect object to Json object, note: json object does not contain scene and geoGraphicObject objects (not completed)
Returns:
Json string

updateEffect(options)

Set effect properties
Name Type Description
options Object optional Object with the following properties:
Name Type Description
point MPoint3D optional Location point
rotate MPoint3D optional Rotation
scale MPoint3D optional Scaling

Type Definitions

callback(params)

Callback function of mouse click event
Name Type Description
params Object Return parameter object
Name Type Description
object Object Signage object
e Object Screen coordinates
Name Type Description
x Number Screen X Coordinates
y Number Screen Y Coordinates