Class Style

java.lang.Object
dev.avelar.mapnik.Style

public final class Style extends Object
A named set of Rules. Add it to a map with MapnikMap.addStyle(dev.avelar.mapnik.Style), then refer to it from a layer with Layer.addStyle(java.lang.String).
  • Method Details

    • create

      public static Style create(String name)
    • fromXml

      public static Style fromXml(String xml)
      Read a style from its XML, such as one toXml() wrote or one taken from a Mapnik map file. Throws IllegalArgumentException if the text is not a well-formed <Style> element. DTDs are refused.
    • attributes

      public Map<String,String> attributes()
      The style's own attributes, such as opacity and comp-op, as written.
    • name

      public String name()
    • opacity

      public Style opacity(double v)
      Opacity of everything drawn by this style, from 0 to 1.
    • compOp

      public Style compOp(String v)
      Compositing mode used when the style's layer is blended onto the map, such as multiply.
    • compOp

      public Style compOp(BlendMode mode)
    • filterMode

      public Style filterMode(Style.FilterMode mode)
    • imageFilters

      public Style imageFilters(String filters)
      Image filters applied to the layer after it is drawn, for example "blur(10)".
    • add

      public Style add(Rule... rules)
    • rules

      public List<Rule> rules()
    • toXml

      public String toXml()
    • toString

      public String toString()
      Overrides:
      toString in class Object