Options
All
  • Public
  • Public/Protected
  • All
Menu

Module ria/ogc/se/SEPainterFactory

This module provides factory methods to create a LuciadRIA feature painter based on an Symbology Encoding file.

Supported versions and limitations

  • Supports the styling of feature data with the OpenGIS Symbology Encoding specification version 1.1.0 (OGC 05-077r4)
  • Does not supportCoverageStyle encodings.
  • Supported features:
    • FeatureTypeStyle: describes the styling for a feature type. It is possible to create a FeatureTypeStyle with multiple Rules.
    • Rules: Styling Rules contain one or more symbolizers, OGC filters and scale range limitations.
    • Symbolizers: Styling options. Styling options that are not available in a LuciadRIA FeaturePainter are ignored. You can define OGC Filter Expressions in a symbolizer where the specification allows this.
      More information about the supported features for the different symbolizers can be found below.
  • PointSymbolizer
    • You can define ExternalGraphic instances with OnlineResource and InlineContent elements. This corresponds to the way you can paint icons with the drawIcon() method of the FeaturePainter. It is possible to map ExternalGraphic instances to icon images by specifying an IconProvider in the SEPainterCreateOptions.
    • Mark is supported with WellKnownName elements that contain well-known shape names. The allowed values include square, circle, triangle, star, cross, x, pentagon and hexagon.
      If you use an unrecognized name, the value is defaulted to square.
    • All web formats that can be rendered on an HTML5 canvas are supported, including SVG graphics. For InlineContent elements, both base64 and XML encodings are supported for SVG graphics, while for other formats only base64 encoding is supported.
      It is possible to configure the Size, Displacement, Rotation, AnchorPoint and Opacity of the Graphic. Other point symbolizer styling options are ignored.
      It is possible to combine multiple graphics in a single PointSymbolizer.
      It is possible to define a unit of measure for your PointSymbolizer. Both Size and Displacement will be interpreted correctly according to how you specified your unit of measure, allowing to draw world sized icons.
  • LineSymbolizer
    • It is possible to define the perpendicular offset for a line symbolizer.
    • It is possible to define the following SVGParameters for a line symbolizer Stroke: GraphicStroke, stroke, stroke-width, stroke-opacity, stroke-dasharray, stroke-dashoffset.
      Other parameters that affect the line symbolizer are ignored.
  • PolygonSymbolizer
    • To define the stroke of a polygon, you can use the SVGParameters GraphicStroke, stroke, stroke-width, stroke-opacity, stroke-dasharray, stroke-dashoffset.
    • To fill a polygon, you can use the fill and fill-opacity SVGParameters to configure the interior color and opacity of the shape. Use a GraphicFill to specify a fill pattern. You can adjust the Size, Rotation and Opacity of the pattern. You can also use Mark as a fill pattern.
  • TextSymbolizer
    • Use label to specify the text contents of the label. All Font parameters - family, style, size, and weight - are supported. All Fill and Halo properties are supported, except graphicFill patterns.
    • For labelPlacement, use either a PointPlacement to label features relative to the focus point of its Shape, or a LinePlacement to indicate that labels should follow the outline of the Shape.
      • PointPlacement: the rotation, anchorPoint and Displacement properties are supported.
      • LinePlacement:
        • If a unit of measure is expressed in meter or feet, isAligned is forced to be true.
        • If the isRepeated property is set to true, the label is repeated along the path, taking into account the values for the gap and initialGap properties.
      • The generalizeLine property is not supported.
    • LuciadRIA also supports a VendorOption named "conflictResolution" in TextSymbolizers. Setting this option to false will disable decluttering for those labels. For example:
      <TextSymbolizer>
         ...
         <VendorOption name="conflictResolution">false</VendorOption>
      </TextSymbolizer>
         When decluttering is disabled with the <a href="../interfaces/_ria_ogc_se_sepainterfactory_d_.sepaintercreateoptions.html">SEPainterCreateOptions</a>, this flag can also be used to enable it again for specific TextSymbolizers.
        </li>
      </ul>
    • Unit of measure support
      • The Symbology Encoding painter respects the uom unit-of-measure attribute in the Line, Polygon and Text Symbolizers. It allows you to define the size of lines, icons or text in meters or feet instead of pixels.
      • In the Polygon symbolizer, the uom attribute is applied to the Stroke element only. For other elements in the Polygon symbolizer, all units are measured in pixels.
      • Note that for a TextSymbolizer with a unit of measure in meters or feet, LuciadRIA will render the text as bodies instead of labels. This means that the text might appear underneath other layers. It will also not be repositioned or decluttered. Additionally, isAligned is always forced to true. isAligned=false is not supported for TextSymbolizers with a unit of measure in meters or feet.

Overview

Functions

createPainterFromString

  • Generates a LuciadRIA painter from a Symbology Encoding in a JavaScript String. This method can be used if the Symbology Encoding definition is already downloaded from the server, for example by means of an Ajax call.

    Currently the Factory only supports FeatureTypeStyle symbology encodings. CoverageStyle encodings are not supported.

    For more information on supported features, please refer to the developer guide.

    throws

    InvalidXMLError if an error in the Symbology Encoding definition was encountered.

    Parameters

    • seString: string

      The symbology encoding XML definition in a JavaScript String.

    • Optional options: SEPainterCreateOptions

      an object containing configuration parameters for the factory

    Returns Promise<FeaturePainter>

    A promise for a LuciadRIA feature painter that realizes the given Symbology Encoding file.

createPainterFromURL

  • Generates a LuciadRIA painter from a Symbology Encoding in a file located on a web server. The symbology encoding file is retrieved by means of passing its URL to the factory method.

      //Use the factory method from the SEPainterFactory module to create the painter
      //As input we use the url of the SLD file
      const seURL = "http://foo.com/se/CitiesSymbolizer.xml";
      createPainterFromURL(seURL)
          .then(function(sePainter) {
                //Create a new layer which uses the created painter
                const layer = new FeatureLayer(citiesModel, {
                  label: "Cities Layer",
                  painter: sePainter
                });
                //Add the layer to the map
                map.layerTree.addChild(layer);
              },
              function(error) {
                console.log("could not create a painter from symbology encoding at " + seURL);
              }
          );
    
    throws

    InvalidXMLError if an error in the Symbology Encoding was encountered.

    throws

    Error if the value configuration parameter in the Symbology Encoding is invalid.

    Parameters

    • url: string

      The location of the symbology encoding XML file.

    • Optional options: SEPainterCreateOptions

      an object literal containing painter creation configuration parameters the factory method.

    Returns Promise<FeaturePainter>

    A promise for a LuciadRIA feature painter that realizes the given Symbology Encoding file.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method