Hierarchy

  • FeatureHelper

Properties

$filter_: IFilterService
decimals_: number
ngeoNumberCoordinates_: numberCoordinates
numberFormat_: formatNumber
pointFilterArgs_: any[]

Arguments to apply to the point filter function.

pointFilterFn_: IFilterFilter

Filter function to display point coordinates or null to don't use any filter.

precision_: number
projection_: Projection
spherical: boolean
unitPrefixFormat_: unitPrefix

Methods

  • Clear all properties of a feature, with the exception of the geometry.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns void

  • Returns

    List of style.

    Parameters

    • feature: Feature<Geometry>

      Feature to create the editing styles with.

    Returns Style[]

  • Export features in the given format. The projection of the exported features is: EPSG:4326.

    Parameters

    • features: Feature<Geometry>[]

      Array of vector features.

    • formatType: string

      Format type to export the features.

    Returns void

  • Export features in GPX and download the result to the browser. The projection of the exported features is: EPSG:4326.

    Parameters

    • features: Feature<Geometry>[]

      Array of vector features.

    Returns void

  • Export features in KML and download the result to the browser. The projection of the exported features is: EPSG:4326.

    Parameters

    • features: Feature<Geometry>[]

      Array of vector features.

    Returns void

  • Export features using a given format to a specific filename and download the result to the browser. The projection of the exported features is: EPSG:4326.

    Parameters

    • features: Feature<Geometry>[]

      Array of vector features.

    • format: FeatureFormat

      Format

    • fileName: string

      Name of the file.

    • Optional opt_mimeType: string

      Mime type. Defaults to 'text/plain'.

    Returns void

  • Returns

    Index of found feature

    Parameters

    • features: Feature<Geometry>[]

      Features.

    • fid: string

      Feature id

    Returns number

  • This methods will try to fit a feature into a map view.

    If the feature is already visible, then the map will be zoomed out if the feature is too big for the current view.

    If the feature is not visible but would fit in the map view, the map is panned to the center of the feature.

    If the feature is not visible and would not fit in the map view, the map is fix to the feature's extent.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    • map: Map

      Map.

    • Optional opt_duration: number

      Aimation duration. Defaults to 250.

    Returns void

  • Returns

    Angle.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns number

  • Returns

    The ArrowDirections value of the feature. ArrowDirections.NONE by default.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns string

  • Returns

    Style Arrows style for the line.

    Parameters

    • feature: Feature<LineString>

      Feature with linestring geometry.

    • arrowDirection: string

      An ArrowDirections value.

    • arrowPosition: string

      An ArrowPositions value.

    • color: Color

      an hex Color.

    Returns Style[]

  • Returns

    The ArrowPositions value of the feature. ArrowPositions.FIRST by default.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns string

  • Returns

    Color.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns string

  • Loop in the given coordinates and look one that hits an other given coordinate using a buffer. If one does, return its index.

    Returns

    Index of the coordinate that hits. If none did, -1 is returned.

    Parameters

    • coordinates: Coordinate[]

      Coordinates in which to loop to find the one that hits the other given coordinate.

    • coordinate: Coordinate

      Coordinate that has to hit.

    • min: number

      Minimum number of coordinates required to look for the one that hits.

    • buffer: number

      Buffer, in map view units, to extend the extent with.

    Returns number

  • Returns

    Style.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns Style

  • Returns

    Style.

    Parameters

    • feature: Feature<LineString>

      Feature with linestring geometry.

    Returns Style[]

  • Get the measure of the given feature as a string. For points, you can format the result by setting a filter to apply on the coordinate with the function import('ngeo/misc/FeatureHelper').setPointFilterFn.

    Returns

    Measure.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns string

  • Returns

    Name.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns string

  • Return the properties of a feature, with the exception of the geometry.

    Returns

    Object.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns Object

  • Get a number feature attribute.

    Returns

    , The attribute value

    Parameters

    • feature: Feature<Geometry>

      Feature.

    • attrib: string

      The attribute name.

    Returns number

  • Returns

    Opacity.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns number

  • Returns

    Style.

    Parameters

    • feature: Feature<Geometry>

      Feature with point geometry.

    Returns Style[]

  • Returns

    Style.

    Parameters

    • feature: Feature<Geometry>

      Feature with polygon geometry.

    Returns Style[]

  • Returns

    Color.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns Color

  • This method generates a line string geometry that represents the radius for a given azimut. It expects the input geometry to be a circle.

    Returns

    The line geometry.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    • azimut: number

      Azimut in degrees.

    Returns LineString

  • Returns

    Show at least one arrow.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns boolean

  • Returns

    Show feature label.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns boolean

  • Returns

    Show measure.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns boolean

  • Returns

    Size.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns number

  • Returns

    Stroke.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns number

  • Create and return a style object from a given feature using its inner properties and depending on its geometry type.

    Returns

    The style object.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns Style[]

  • Returns

    Style.

    Parameters

    • feature: Feature<Geometry>

      Feature with point geometry, rendered as text.

    Returns Style

  • Return the type of geometry of a feature using its geometry property and some inner properties.

    Returns

    The type of geometry.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns string

  • For a given feature, if its geometry supports vertice that can be removed on click, then check if there is a vertex a the given coordinate. The map current map view resolution is used to calculate a buffer of the size of the vertex (using its style).

    If a vertex hits, then return its information, i.e. its indexes among the coordinates of the geometry of the feature, as an array. For example, if the geometry is a LineString, then the coordinates are an array of ol.Coordinate, so a single index is required. For a polygon, coordinates are an array of array of coordinates, so 2 indexes are required.

    If removing a vertex would make the geometry invalid, then the vertex info is not returned.

    Returns

    The indexes of the vertex (coordinate) that hits.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    • coordinate: Coordinate

      Coordinate.

    • resolution: number

      Current map view resolution.

    Returns number[]

  • Create and return a style object to be used for vertex.

    Returns

    Style.

    Parameters

    • Optional opt_incGeomFunc: boolean

      Whether to include the geometry function or not. One wants to use the geometry function when you want to draw the vertex of features that don't have point geometries. One doesn't want to include the geometry function if you just want to have the style object itself to be used to draw features that have point geometries. Defaults to true.

    Returns Style

  • Get an optional number feature attribute.

    Returns

    , The attribute value

    Parameters

    • feature: Feature<Geometry>

      Feature.

    • attrib: string

      The attribute name.

    Returns number

  • Remove a vertex from a feature using the given information (indexes).

    Parameters

    • feature: Feature<Geometry>

      Feature.

    • vertexInfo: number[]

      The indexes of the vertex (coordinate) to remove.

    Returns void

  • Set the style of a feature using its inner properties and depending on its geometry type.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    • Optional opt_select: boolean

      Whether the feature should be rendered as selected, which includes additional vertex and halo styles.

    Returns void

  • Returns

    Whether the feature supports having its vertex removed or not. Does not validate the number of coordinates.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns boolean

  • Returns

    Whether the feature supports vertex or not.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns boolean

Generated using TypeDoc