3.1.2.18 style Element

The style element has the following definition:

<!ELEMENT style (svg | AdvancedStyle)?>
<!ATTLIST style
  name CDATA #REQUIRED
>

The <style> element lets you specify a dynamically defined style. The style can be either of the following:

  • An SVG description representing a color, line, marker, area, or text style.
  • An advanced style definition (see Advanced Styles) representing a bucket, a color scheme, or a variable marker style.

The name attribute identifies the style name.

The following example shows an excerpt that dynamically defines two styles (a color style and an advanced style) for a map request:

<map_request>
    ...
    <styles>
        <style name="color_red">
            <svg width="1in"
                 height="1in">
                <g class="color"
                   style="stroke:red;stroke-opacity:100;fill:red;fill-opacity:100">
                    <rect width="50"
                          height="50" />
                </g>
            </svg>
        </style>
        <style name="ranged_bucket_style">
            <AdvancedStyle>
                <BucketStyle>
                    <Buckets>
                        <RangedBucket seq="0"
                                      label="less than 100k"
                                      high="100000.0"
                                      style="C.RB13_13" />
                        <RangedBucket seq="1"
                                      label="100k - 150k"
                                      low="100000.0"
                                      high="150000.0"
                                      style="C.RB13_1" />
                        <RangedBucket seq="2"
                                      label="150k - 250k"
                                      low="150000.0"
                                      high="250000.0"
                                      style="C.RB13_4" />
                        <RangedBucket seq="3"
                                      label="250k - 350k"
                                      low="250000.0"
                                      high="350000.0"
                                      style="C.RB13_7" />
                        <RangedBucket seq="4"
                                      label="350k - 450k"
                                      low="350000.0"
                                      high="450000.0"
                                      style="C.RB13_10" />
                    </Buckets>
                </BucketStyle>
            </AdvancedStyle>
        </style>
    </styles>
</map_request>