Graphics Reference
In-Depth Information
markerLineMetadata.createSymbolLayer(
{'width': '0.26',
'color': arrowColor,
'rotate': '1',
'placement': 'interval',
'interval' : '20',
'offset': '0'})
subSymbol = symbolLayer.subSymbol()
subSymbol.deleteSymbolLayer(0)
triangle = markerMetadata.createSymbolLayer(
{'name': 'filled_arrowhead',
'color': arrowColor,
'color_border': arrowColor,
'offset': '0,0',
'size': '3',
'outline_width': '0.5',
'output_unit': 'mapunit',
'angle': '180'})
subSymbol.appendSymbolLayer(triangle)
symbol.appendSymbolLayer(symbolLayer)
return symbol
The complex part of this method is the code to draw an arrowhead onto the track to indic-
ate the track's direction. Apart from this, we simply draw a line to represent the track us-
ing the specified color and width, and if the track is closed, we draw the track as a dotted
line.
Our final task here is to add some more entries to our constants.py module to repres-
ent the various sizes and line widths used by our renderers. Add the following to the end
of this module:
ROAD_WIDTH = 0.0001
TRAIL_WIDTH = 0.00003
POINT_SIZE = 0.0004
All of these values are in map units.
Search WWH ::




Custom Search