complex line symbols with cumberland
June 6th, 2009Back in the day, when I was writing some awesome ArcIMS app, I could create some elaborate line symbology in ArcXML:
<LAYER type="featureclass" name="ROADS" visible="true" id="2">
<DATASET name="ROADS" type="line" workspace="shp_ws-0" />
<GROUPRENDERER>
<SIMPLERENDERER>
<SIMPLELINESYMBOL transparency="1.0" type="solid" width="8" captype="round" jointype="round" color="0,0,0" />
</SIMPLERENDERER>
<SIMPLERENDERER>
<SIMPLELINESYMBOL transparency="1.0" type="solid" width="6" captype="round" jointype="round" color="255,0,0" />
</SIMPLERENDERER>
<SIMPLERENDERER>
<SIMPLELINESYMBOL transparency="1.0" type="solid" width="1" captype="round" jointype="round" color="255,255,255" />
</SIMPLERENDERER>
</GROUPRENDERER>
</LAYER>
...
(source)
What's nice about this is that it is all built into a single layer element. Now, you can't do this directly in cumberland map xml, but you can still achieve much of this functionality. The trick is to just duplicate the layer using different symbology:
<Layer>
<!--Interstates 1-->
...
<Styles>
...
<Style>
<Simplify>true</Simplify>
<SimplifyTolerance>200</SimplifyTolerance>
<MaxScale>399</MaxScale>
<LineColor>255,155,56,0</LineColor>
<LineWidth>6</LineWidth>
</Style>
</Styles>
</Layer>
<Layer>
<!--Interstates 2-->
...
<Styles>
...
<Style>
<ShowLabels>true</ShowLabels>
<LabelPixelOffset>0</LabelPixelOffset>
<LabelFont>SansSerif</LabelFont>
<LabelFontEmSize>6</LabelFontEmSize>
<DrawPointSymbolOnPolyLine>true</DrawPointSymbolOnPolyLine>
<CalculateLabelAngleForPolyLine>false</CalculateLabelAngleForPolyLine>
<PointSymbol>Image</PointSymbol>
<PointSize>15</PointSize>
<FillColor>255,255,0,0</FillColor>
<PointSymbolImagePath>images/interstate.png</PointSymbolImagePath>
<Simplify>true</Simplify>
<SimplifyTolerance>200</SimplifyTolerance>
<MaxScale>399</MaxScale>
<LineColor>255,255,156,0</LineColor>
<LineWidth>4</LineWidth>
</Style>
</Styles>
</Layer>
...
This draws the layer twice, giving us our complex symbol effect:

complex line symbols
There are additional variations that could be done with this, such as drawing a dashed/dotted line on top of a solid line and so forth. Full demo and source of this map is here.
On a side note: Isn't cumberland xml so much cleaner than ArcXML? Excessive use of attributes is an XML no-no. Let the xml schema take care of preventing duplicates.











