LineStyle
Description
The LineStyle element defines a style for a line.
Context
Table 1 lists the elements that can contain, or be contained by, a LineStyle element.
Contained by | Element | Contains |
---|---|---|
NamedStyle or CompositeStyle or AreaStyle |
LineStyle |
Attributes
Table 2 lists the attributes of a LineStyle element.
Attribute | Description |
---|---|
id |
A unique identifier for the element. |
name |
A descriptive name for the element. |
stroke |
A string value specifying the color of the line. The value can be any valid CSS color. (See http://www.w3.org/TR/REC-CSS1#color-units.) The |
stroke-opacity |
A floating-point value from 0 to 1 specifying the opacity of the line. A value of 0 means that the line is totally transparent. A value of 1 means that the line is totally opaque. A value of 0.5 means that the line is 50% translucent. The |
width |
An integer value specifying the width of the line. The |
width-unit |
A reference to an imagesize in the mapinfo codespace, which specifies a width unit. The |
miterlimit |
A limit on the ratio of the miter length to the line width for The |
linecap |
An enumeration value specifying the decorative shape to be used at the end of open subpaths when they are stroked. The possible values are:
The value The |
linejoin |
An enumeration value specifying the shape to be used at the corners of paths or basic shapes when they are stroked. The possible values are:
The value The |
marker-placement |
An enumeration value specifying the placement style for markers. The possible values are:
Note: Currently only
none is supported for marker placement.Markers can be placed at the start, end, or middle nodes of line segments and can be drawn along line segments continuously. The values The |
dasharray |
An array of comma or whitespace delimited integer values that specify the lengths (in pixels) of alternating dashes and spaces for a dashed line. For example, The array must contain an even number of positive integers, or the special value For example, the following value
specifies a dashed line in which the first dash is 10 pixels long, followed by a space 20 pixels long, followed by a dash 30 pixels long, followed by a space 10 pixels long. The pattern then repeats for the length of the dashed line.The |
dashoffset |
A positive integer value specifying the number of units (in pixels) from the start of the line segment at which the first dash of a dashed line will be drawn. The |
Example
This example specifies a dashed black line that is one pixel wide.
<?xml version="1.0" encoding="UTF-8"?>
<NamedStyle
version="MXP_WorkSpace_1_5"
xmlns="http://www.mapinfo.com/mxp">
<LineStyle
stroke="black"
stroke-opacity="1"
width="1"
width-unit="mapinfo:imagesize pixel">
<Pen>mapinfo:pen 9</Pen>
</LineStyle>
</NamedStyle>