![]() |
![]() |
This section provides comprehensive information about the style of the markers.
A style is a set of properties defining the way to draw the marker geometry.
The style of markers is handled in the API as a JSON string representing a JSON object.
Here are some example of marker styles:
This is a simple two pixels wide red pen :
{ "pen":
{ "enabled" : true,
"width" : 2,
"color" : "#FF0000"
}
}
This is a label with an icon fetched from the internet :
{ "label" :
{ "autoHeight" : false,
"height" : 1,
"symbol" :
{ "enabled" : true,
"src" : "http://google-maps-icons.googlecode.com/files/car.png",
"size" : 100
},
"anchor" :
{ "enabled" : false
}
}
}
This object is made of several properties which will be detailled in this document.
The style of a marker is defined by some general properties and by a simple set of drawing tools:
General properties define the visibility and the opacity of the marker.
visible: bool
opacity: int
Height defines the behaviour of the geometry regarding elevation. Height is used to specify how to use the geometry Z coordinates, if the geometry has to be projected on the ground, and the height offset.
height.heightOffset: double
height.heightMode: int
Possible values are :
The mode clampToGround with an heightOffset of 0 must be used to allow features to be draped on the ground.
Pen defines a linear style to draw the raw geometry.
The pen is used to draw points, lines or contour of polygons. As needed, pen can be rendered in raster or in vector mode.
pen.enabled: bool
pen.renderMode: int
Possible values are :
The raster mode is available only if the height settings is set to draped (heightMode 1, heightOffset 0). With the raster mode, pen width, and pattern length are expressed in meters, whereas with vector mode, they are expressed in pixel (screen pixel).
Note: Vector objects are faster to create than raster objects, For this reason, for applications requiring fast object update, vector render mode is better.
pen.minWidth: double
pen.patternLength: double
A pen style is defined with a combination of 3 independent simple pen styles to allow a large range of custom line style: main, auxLine1 and auxLine2.
pen.width: double //(1 by default) pen.dash: string //(#FFFF by default) pen.color: string //(#00FF00 by default)
pen.auxLine1{
enabled: bool //(false by default)
width: double
dash: string
color: string
}
pen.auxLine2{
enabled: bool //(false by default)
width: double
dash: string
color: string
}
Each simple pen style is defined by the following properties:
enabled: bool
width: double
color: string
dash: string
Examples of dashes:
The combination of the 3 simple pen styles offers a large range of pen styles : bicolor lines, line with outline, etc.
Example of pen styles using simple pen combination:
Brush defines the style for filling areas. Brush defines the way the surface of a polygon is filled; it's not applicable for points or lines.
brush{
enabled: bool //false by default
foregroundColor: string //#00FF00
pattern{
enabled: bool //false by default
src: string
width: double
height: double
}
}
Extrusion allows to extrude the geometry in the Z direction.
The 3D volume is defined by the properties 'height', 'mode' and 'roofGeometry'.
extrusion.enabled: bool
extrusion.height: double
extrusion.mode: int
Possible values are :
extrusion.roof{
enabled: bool //(true by default)
color: string //hexadecimal color (ex. #FF0000)
texture{
enabled: bool //(false by default)
src: string //image url or pseudoloader
width: double //real width of the texture
height: double //real height of the texture
lightEnabled: double //enable face lighting
}
}
The texture is mixed with the color, choose a white color to keep original texture (#FFFFFF).
extrusion.wall{
enabled: bool //(true by default)
color: string
texture{
enabled: bool //(false by default)
src: string //image url or pseudoloader
width: double //real width of the texture
height: double //real height of the texture
alphaEnabled: bool //enable transparency mask
alphaThreshold: int //transparency threshold 0..255
vRepeat: bool //vertical repeat of the pattern
vSpread: bool //vertical adjustment on geometry
vSpreadZones: int //nb of zones for the adjustment
vRoofPosition: double //roof position in % (0..100)
lightEnabled: double //enable face lighting
}
}
extrusion.edge{
enabled: bool //(false by default)
color: string //hexadecimal color
}
extrusion.roofGeometry{
type: int
height: double //height of the roof for non plane roof
}
Possible values are:
Object3d places a 3D model on the geometry.
Object3d properties allow to define the model and its position behaviour according to the geometry.
object3d.enabled: bool
object3d.src: string
object3d.objRefMode: int
Possible values are:
object3d.insertMode: int
Possible values are:
object3d.interval: double
object3d.insertPatternSrc: double
object3d.sizeMode: int
Possible values are:
object3d.sizeX: double object3d.sizeY: double object3d.sizeZ: double // In this release, only the sizeZ property is taken into account
object3d.scaleX: double object3d.scaleY: double object3d.scaleZ: double // In this release, the all axis are scaled with the same ratio
object3d.azimuthMode: int
Possible values are:
object3d.azimuthOffset: double
object3d.pitchOffset: double
Label defines symbol or text annotations.
label.screenScale: bool
Possible values are:
label.alwaysOnTop: bool
Possible values are:
label.autoHeight: bool
Possible values are:
label.height: double
label.orientationMode: int
Possible values are:
label.azimuthOffset: double
label.anchor{
enabled: bool
color: color
width: int
}
label.text{
enabled: bool //(false by default)
text: string
color: color
font{
family: string //font family
size: double //char height
ratio: double //char ratio
resolution: double //font resolution
}
shadow{
style: int
color: color
}
}
The text string is specified with the 'text' property.
label.text.shadow{
style: int
}
Possible values are:
label.symbol{
enabled: bool //(false by default)
src: string //image url or pseudoloader
size: double
}
The image is loaded from the specified source ('src'), all icon formats supported by SpacEyes3D kernel can be used (png, jpg, bmp, gif, tga...).
Information specifies information attached to the marker, and displayed when the user interacts with the marker.
information.tooltip: string
information.infoBalloon: string
information.hyperlink: string
For rerouting events to the API, hyperlinks can include the macro "sp3d_event(".
Tooltip, infoballon and hyperlink strings can include the following parameters that are converted in real time according to the marker context:
For hyperlinks, the following parameter are supported:
| SpacEyes3D Plugin SDK Documentation - generated on Thu Jun 28 09:18:18 2012 - SPACEYES | ![]() |