Skip to content

Instantly share code, notes, and snippets.

@ajashton
Created January 12, 2011 00:00
Show Gist options
  • Save ajashton/775421 to your computer and use it in GitHub Desktop.
Save ajashton/775421 to your computer and use it in GitHub Desktop.

Notes

  • Order of symbolizers in stylesheet = order in XML? (We need to define it somehow…)

Example 1 style

.rail[zoom>10][status='active'] {
  line-cap: butt;
  line-join: round;
  line-color: #333;
  line-width: 1.5;
}

.rail:ties[zoom>10][status='active'] {
  line-width: 6;
  line-dasharray: 1, 6;
}

Example 1 XML

<Style name='class-rail-1'>
  <Rule>
    <Filter>
      <MaxScaleDenominator>400000</MaxScaleDenominator>
    </Filter>
    <!-- Default (unnamed) symbolizer -->
    <LineSymbolizer
      stroke="#333333"
      stroke-linecap="butt"
      stroke-linejoin="round"
      stroke-width="1.5"
    />
    <!-- :ties -->
    <LineSymbolizer 
      stroke="#333333"
      stroke-dasharray="1,6"
      stroke-linecap="butt"
      stroke-linejoin="round"
      stroke-width="6"
    />
  </Rule>
</Style>

Example 2 style

#park:glow0,
#park:glow1,
#park:glow2,
#park:glow3 {
  line-color: #fff;
  line-opacity: 0.1;
}

#park:glow0 { line-width: 1; }
#park:glow1 { line-width: 3; }
#park:glow2 { line-width: 5; }
#park:glow3 { line-width: 7; }

#park {
  polygon-fill: #7c8;
}

Example 2 XML

<Style name='id-park-1'>
  <Rule>
    <!-- :glow0 -->
    <LineSymbolizer
      stroke="#FFFFFF"
      stroke-opacity="0.1"
      stroke-width="1"
    />
    <!-- :glow1 -->
    <LineSymbolizer 
      stroke="#FFFFFF"
      stroke-opacity="0.1"
      stroke-width="3"
    />
    <!-- :glow2 -->
    <LineSymbolizer
      stroke="#FFFFFF"
      stroke-opacity="0.1"
      stroke-width="5"
    />
    <!-- :glow3 -->
    <LineSymbolizer
      stroke="#FFFFFF"
      stroke-opacity="0.1"
      stroke-width="7"
    />
    <!-- Default (unnamed) symbolizer -->
    <PolygonSymbolizer fill="#77CC88" />
  </Rule>
</Style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment