This is an old revision of the document!
Use a path element to draw a line or polygon whose shape consists of a series of points in a path.
Root Element | map | |
---|---|---|
Element | path | |
Attribute | Format | Remarks |
stroke_pattern | double array | line pattern described in an array of doubles |
stroke_width | float | line width in pixels |
stroke_color | string | color id name |
fill_color | string | color id name |
close | boolean | close path yes/no |
Each path consists of at least two <point> elements where each <point> is connected to the next <point>. The shape is closed if close=“true” is defined.
<path stroke_color="myPredefinedColor" stroke_width="1" > <point lat="N0513000" lon="E0020000"/> <point lat="N0514245" lon="E0021001"/> <point lat="N0513814" lon="E0023000"/> </path>
By adding a fill_color the shape can be filled in
<path fill_color="myPredefinedColor" close="true"> <point lat="N0513000" lon="E0020000"/> <point lat="N0514245" lon="E0021001"/> <point lat="N0513814" lon="E0023000"/> </path>
The fill_color and stroke_color attributes may be combined on a single path to form a filled shape with a distinct border color.
The following code draws a rectangle:
<path stroke_color="myPredefinedColor" close="true"> <point lat="N0504413" lon="E0043108"/> <point lat="N0504421" lon="E0042601"/> <point lat="N0504528" lon="E0042119"/> <point lat="N0504730" lon="E0041718"/> </path>
The following code draws the same rectangle, with a fill color and a patterned border:
<path stroke_color="myPredefinedColor" stroke_pattern="2,2" fill_color="otherPredefinedColor" close="true"> <point lat="N0504413" lon="E0043108"/> <point lat="N0504421" lon="E0042601"/> <point lat="N0504528" lon="E0042119"/> <point lat="N0504730" lon="E0041718"/> </path>