Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • FeatureHelper

Index

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

  • clearNonSpatialProperties(feature: Feature<Geometry>): void
  • Clear all properties of a feature, with the exception of the geometry.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns void

  • createEditingStyles(feature: Feature<Geometry>): Style[]
  • Parameters

    • feature: Feature<Geometry>

      Feature to create the editing styles with.

    Returns Style[]

    List of style.

  • export(features: Feature<Geometry>[], formatType: string): void
  • 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

  • exportGPX(features: Feature<Geometry>[]): 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

  • exportKML(features: Feature<Geometry>[]): 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: Feature<Geometry>[], format: FeatureFormat, fileName: string, opt_mimeType: string): 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.

    • opt_mimeType: string

    Returns void

  • findFeatureIndexByFid(features: Feature<Geometry>[], fid: string): number
  • Parameters

    • features: Feature<Geometry>[]

      Features.

    • fid: string

      Feature id

    Returns number

    Index of found feature

  • fitMapToFeature(feature: Feature<Geometry>, map: Map, opt_duration: number): void
  • 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.

    • opt_duration: number

    Returns void

  • getAngleProperty(feature: Feature<Geometry>): number
  • getArrowDirectionProperty(feature: Feature<Geometry>): string
  • Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns string

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

  • getArrowLineStyles_(feature: Feature<LineString>, arrowDirection: string, arrowPosition: string, color: Color): Style[]
  • 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[]

    Style Arrows style for the line.

  • getArrowPositionProperty(feature: Feature<Geometry>): string
  • Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns string

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

  • getColorProperty(feature: Feature<Geometry>): string
  • getCoordinateIndexThatHitsAt_(coordinates: Coordinate[], coordinate: Coordinate, min: number, buffer: number): number
  • Loop in the given coordinates and look one that hits an other given coordinate using a buffer. If one does, return its index.

    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

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

  • getHaloStyle_(feature: Feature<Geometry>): Style
  • getLineStringStyle_(feature: Feature<LineString>): Style[]
  • getMeasure(feature: Feature<Geometry>): string
  • 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 {@link import('ngeo/misc/FeatureHelper').setPointFilterFn}.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns string

    Measure.

  • getNameProperty(feature: Feature<Geometry>): string
  • getNonSpatialProperties(feature: Feature<Geometry>): Object
  • Return the properties of a feature, with the exception of the geometry.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns Object

    Object.

  • getNumber(feature: Feature<Geometry>, attrib: string): number
  • Get a number feature attribute.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    • attrib: string

      The attribute name.

    Returns number

    , The attribute value

  • getOpacityProperty(feature: Feature<Geometry>): number
  • getPointStyle_(feature: Feature<Geometry>): Style[]
  • getPolygonStyle_(feature: Feature<Geometry>): Style[]
  • getRGBAColorProperty(feature: Feature<Geometry>): Color
  • getRadiusLine(feature: Feature<Geometry>, azimut: number): LineString
  • This method generates a line string geometry that represents the radius for a given azimut. It expects the input geometry to be a circle.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    • azimut: number

      Azimut in degrees.

    Returns LineString

    The line geometry.

  • getShowArrowsProperty(feature: Feature<Geometry>): boolean
  • getShowLabelProperty(feature: Feature<Geometry>): boolean
  • getShowMeasureProperty(feature: Feature<Geometry>): boolean
  • getSizeProperty(feature: Feature<Geometry>): number
  • getStrokeProperty(feature: Feature<Geometry>): number
  • getStyle(feature: Feature<Geometry>): Style[]
  • Create and return a style object from a given feature using its inner properties and depending on its geometry type.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns Style[]

    The style object.

  • getTextStyle_(feature: Feature<Geometry>): Style
  • getType(feature: Feature<Geometry>): string
  • Return the type of geometry of a feature using its geometry property and some inner properties.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns string

    The type of geometry.

  • getVertexInfoAtCoordinate(feature: Feature<Geometry>, coordinate: Coordinate, resolution: number): number[]
  • 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.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    • coordinate: Coordinate

      Coordinate.

    • resolution: number

      Current map view resolution.

    Returns number[]

    The indexes of the vertex (coordinate) that hits.

  • getVertexStyle(opt_incGeomFunc: boolean): Style
  • Create and return a style object to be used for vertex.

    Parameters

    • opt_incGeomFunc: boolean

    Returns Style

    Style.

  • optNumber(feature: Feature<Geometry>, attrib: string): number
  • Get an optional number feature attribute.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    • attrib: string

      The attribute name.

    Returns number

    , The attribute value

  • removeVertex(feature: Feature<Geometry>, vertexInfo: number[]): void
  • 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

  • setProjection(projection: Projection): void
  • setStyle(feature: Feature<Geometry>, opt_select: boolean): void
  • Set the style of a feature using its inner properties and depending on its geometry type.

    Parameters

    • feature: Feature<Geometry>

      Feature.

    • opt_select: boolean

    Returns void

  • supportsVertexRemoval_(feature: Feature<Geometry>): boolean
  • Parameters

    • feature: Feature<Geometry>

      Feature.

    Returns boolean

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

  • supportsVertex_(feature: Feature<Geometry>): boolean

Generated using TypeDoc