Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ivac2:firdef_map_path [2015/06/07 23:02]
splendor.bouman [path element]
ivac2:firdef_map_path [2017/11/24 11:21] (current)
splendor.bouman
Line 1: Line 1:
 ====== path element ====== ====== path element ======
  
-Use a path element to draw a line or polygon ​consisting ​of a series of points in a path.+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|| ^Element|path||
 ^Attribute^Format^Remarks^ ^Attribute^Format^Remarks^
-|pattern|double array|line pattern described in an array of doubles|+|stroke_pattern|double array|line ​[[firdef_map_pattern|pattern]] described in an array of doubles|
 |stroke_width|float|line width in pixels| |stroke_width|float|line width in pixels|
 |stroke_color|string|color id name| |stroke_color|string|color id name|
 |fill_color|string|color id name| |fill_color|string|color id name|
 |close|boolean|close path yes/no| |close|boolean|close path yes/no|
 +|followgrid|boolean|If true, paths follow grid (rhumb line). If false paths follow great circle ''​NEW''​|
  
 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. 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.
  
 {{:​ivac2:​firdef:​firdef_opengl_linestrip.png?​|}} {{:​ivac2:​firdef:​firdef_opengl_linestrip.png?​|}}
- 
- 
-The drawing can be written as: 
  
 <code XML> <code XML>
-  <path stroke_color="​myPredefinedColor"​ stroke_width="​1">​+  <path stroke_color="​myPredefinedColor"​ stroke_width="​1"​ >
       <point x="v0 x" y="v0 y" />       <point x="v0 x" y="v0 y" />
       <point x="v1 x" y="v1 y" />       <point x="v1 x" y="v1 y" />
Line 27: Line 26:
 </​code>​ </​code>​
  
- +By adding a fill_color the shape can be filled in
-<​HTML>​ +
-<p style="​border:​1px dashed #​C11B17;​color:#​C11B17;">​ +
-Use <​b>​path</​b>​ instead of <​b>​lines</​b>​ to draw continuous lines. +
-</​p>​ +
-</​HTML>​ +
- +
-By adding a fill_color the path can be filled in to form a polygon+
  
 {{:​ivac2:​firdef:​firdef_opengl_polygon.png?​|}} {{:​ivac2:​firdef:​firdef_opengl_polygon.png?​|}}
Line 49: Line 41:
 </​code>​ </​code>​
  
----- +The fill_color and stroke_color attributes may be combined on a single path to form a filled shape with a distinct border color.
-[[ivac2:​firdef|Back]]+
  
-===== examples ​=====+===== Examples ​=====
  
 The following code draws a rectangle: The following code draws a rectangle:
Line 65: Line 56:
 </​code>​ </​code>​
  
 +The following code draws the same rectangle, with a fill color and a patterned border:
 +
 +<code XML>
 +  <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>​
 +</​code>​