### Hierarchy

- FeatureHelper

## Index

### Properties

- $filter_
- decimals_
- ngeoNumberCoordinates_
- numberFormat_
- pointFilterArgs_
- pointFilterFn_
- precision_
- projection_
- spherical
- unitPrefixFormat_

### Methods

- clearNonSpatialProperties
- createEditingStyles
- createTextStyle_
- export
- exportGPX
- exportKML
- export_
- findFeatureIndexByFid
- fitMapToFeature
- getAngleProperty
- getArrowDirectionProperty
- getArrowLineStyles_
- getArrowPositionProperty
- getColorProperty
- getCoordinateIndexThatHitsAt_
- getHaloStyle_
- getLineStringStyle_
- getMeasure
- getNameProperty
- getNonSpatialProperties
- getNumber
- getOpacityProperty
- getPointStyle_
- getPolygonStyle_
- getRGBAColorProperty
- getRadiusLine
- getShowArrowsProperty
- getShowLabelProperty
- getShowMeasureProperty
- getSizeProperty
- getStrokeProperty
- getStyle
- getTextStyle_
- getType
- getVertexInfoAtCoordinate
- getVertexStyle
- optNumber
- removeVertex
- setProjection
- setStyle
- supportsVertexRemoval_
- supportsVertex_

## Properties

### $filter_

$filter_: IFilterService

- Defined in src/misc/FeatureHelper.js:147

### decimals_

decimals_: number

- Defined in src/misc/FeatureHelper.js:152

### ngeoNumberCoordinates_

ngeoNumberCoordinates_: numberCoordinates

- Defined in src/misc/FeatureHelper.js:177

### numberFormat_

numberFormat_: formatNumber

- Defined in src/misc/FeatureHelper.js:167

### pointFilterArgs_

pointFilterArgs_: any[]

- Defined in src/misc/FeatureHelper.js:193

Arguments to apply to the point filter function.

### pointFilterFn_

pointFilterFn_: IFilterFilter

- Defined in src/misc/FeatureHelper.js:186

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

### precision_

precision_: number

- Defined in src/misc/FeatureHelper.js:157

### projection_

projection_: Projection

- Defined in src/misc/FeatureHelper.js:209

### spherical

spherical: boolean

- Defined in src/misc/FeatureHelper.js:162

### unitPrefixFormat_

unitPrefixFormat_: unitPrefix

- Defined in src/misc/FeatureHelper.js:172

## Methods

### clearNonSpatialProperties

- clearNonSpatialProperties(feature: Feature<Geometry>): void

- - Defined in src/misc/FeatureHelper.js:1636

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

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature.

  #### Returns void

### createEditingStyles

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

- - Defined in src/misc/FeatureHelper.js:646

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature to create the editing styles with.

  #### Returns Style[]

  List of style.

### createTextStyle_

- createTextStyle_(options: TextOptions): Text

- - Defined in src/misc/FeatureHelper.js:1337

  #### Parameters

  - ##### options: TextOptions

    Options.

  #### Returns Text

  Style.

### export

- export(features: Feature<Geometry>[], formatType: string): void

- - Defined in src/misc/FeatureHelper.js:1251

  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

- exportGPX(features: Feature<Geometry>[]): void

- - Defined in src/misc/FeatureHelper.js:1270

  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

- exportKML(features: Feature<Geometry>[]): void

- - Defined in src/misc/FeatureHelper.js:1284

  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_

- export_(features: Feature<Geometry>[], format: FeatureFormat, fileName: string, opt_mimeType: string): void

- - Defined in src/misc/FeatureHelper.js:1302

  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

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

- - Defined in src/misc/FeatureHelper.js:1651

  #### Parameters

  - ##### features: Feature<Geometry>[]

    Features.

  - ##### fid: string

    Feature id

  #### Returns number

  Index of found feature

### fitMapToFeature

- fitMapToFeature(feature: Feature<Geometry>, map: Map, opt_duration: number): void

- - Defined in src/misc/FeatureHelper.js:1495

  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

- getAngleProperty(feature: Feature<Geometry>): number

- - Defined in src/misc/FeatureHelper.js:1120

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature.

  #### Returns number

  Angle.

### getArrowDirectionProperty

- getArrowDirectionProperty(feature: Feature<Geometry>): string

- - Defined in src/misc/FeatureHelper.js:1222

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature.

  #### Returns string

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

### getArrowLineStyles_

- getArrowLineStyles_(feature: Feature<LineString>, arrowDirection: string, arrowPosition: string, color: Color): Style[]

- - Defined in src/misc/FeatureHelper.js:342

  #### 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

- getArrowPositionProperty(feature: Feature<Geometry>): string

- - Defined in src/misc/FeatureHelper.js:1234

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature.

  #### Returns string

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

### getColorProperty

- getColorProperty(feature: Feature<Geometry>): string

- - Defined in src/misc/FeatureHelper.js:1130

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature.

  #### Returns string

  Color.

### getCoordinateIndexThatHitsAt_

- getCoordinateIndexThatHitsAt_(coordinates: Coordinate[], coordinate: Coordinate, min: number, buffer: number): number

- - Defined in src/misc/FeatureHelper.js:823

  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_

- getHaloStyle_(feature: Feature<Geometry>): Style

- - Defined in src/misc/FeatureHelper.js:1036

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature.

  #### Returns Style

  Style.

### getLineStringStyle_

- getLineStringStyle_(feature: Feature<LineString>): Style[]

- - Defined in src/misc/FeatureHelper.js:289

  #### Parameters

  - ##### feature: Feature<LineString>

    Feature with linestring geometry.

  #### Returns Style[]

  Style.

### getMeasure

- getMeasure(feature: Feature<Geometry>): string

- - Defined in src/misc/FeatureHelper.js:1373

  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

- getNameProperty(feature: Feature<Geometry>): string

- - Defined in src/misc/FeatureHelper.js:1151

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature.

  #### Returns string

  Name.

### getNonSpatialProperties

- getNonSpatialProperties(feature: Feature<Geometry>): Object

- - Defined in src/misc/FeatureHelper.js:1618

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

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature.

  #### Returns Object

  Object.

### getNumber

- getNumber(feature: Feature<Geometry>, attrib: string): number

- - Defined in src/misc/FeatureHelper.js:501

  Get a number feature attribute.

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature.

  - ##### attrib: string

    The attribute name.

  #### Returns number

  , The attribute value

### getOpacityProperty

- getOpacityProperty(feature: Feature<Geometry>): number

- - Defined in src/misc/FeatureHelper.js:1161

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature.

  #### Returns number

  Opacity.

### getPointStyle_

- getPointStyle_(feature: Feature<Geometry>): Style[]

- - Defined in src/misc/FeatureHelper.js:430

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature with point geometry.

  #### Returns Style[]

  Style.

### getPolygonStyle_

- getPolygonStyle_(feature: Feature<Geometry>): Style[]

- - Defined in src/misc/FeatureHelper.js:514

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature with polygon geometry.

  #### Returns Style[]

  Style.

### getRGBAColorProperty

- getRGBAColorProperty(feature: Feature<Geometry>): Color

- - Defined in src/misc/FeatureHelper.js:1139

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature.

  #### Returns Color

  Color.

### getRadiusLine

- getRadiusLine(feature: Feature<Geometry>, azimut: number): LineString

- - Defined in src/misc/FeatureHelper.js:1595

  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

- getShowArrowsProperty(feature: Feature<Geometry>): boolean

- - Defined in src/misc/FeatureHelper.js:1197

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature.

  #### Returns boolean

  Show at least one arrow.

### getShowLabelProperty

- getShowLabelProperty(feature: Feature<Geometry>): boolean

- - Defined in src/misc/FeatureHelper.js:1183

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature.

  #### Returns boolean

  Show feature label.

### getShowMeasureProperty

- getShowMeasureProperty(feature: Feature<Geometry>): boolean

- - Defined in src/misc/FeatureHelper.js:1169

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature.

  #### Returns boolean

  Show measure.

### getSizeProperty

- getSizeProperty(feature: Feature<Geometry>): number

- - Defined in src/misc/FeatureHelper.js:1206

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature.

  #### Returns number

  Size.

### getStrokeProperty

- getStrokeProperty(feature: Feature<Geometry>): number

- - Defined in src/misc/FeatureHelper.js:1214

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature.

  #### Returns number

  Stroke.

### getStyle

- getStyle(feature: Feature<Geometry>): Style[]

- - Defined in src/misc/FeatureHelper.js:247

  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_

- getTextStyle_(feature: Feature<Geometry>): Style

- - Defined in src/misc/FeatureHelper.js:627

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature with point geometry, rendered as text.

  #### Returns Style

  Style.

### getType

- getType(feature: Feature<Geometry>): string

- - Defined in src/misc/FeatureHelper.js:1443

  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

- getVertexInfoAtCoordinate(feature: Feature<Geometry>, coordinate: Coordinate, resolution: number): number[]

- - Defined in src/misc/FeatureHelper.js:735

  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

- getVertexStyle(opt_incGeomFunc: boolean): Style

- - Defined in src/misc/FeatureHelper.js:854

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

  #### Parameters

  - ##### opt_incGeomFunc: boolean

  #### Returns Style

  Style.

### optNumber

- optNumber(feature: Feature<Geometry>, attrib: string): number

- - Defined in src/misc/FeatureHelper.js:481

  Get an optional number feature attribute.

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature.

  - ##### attrib: string

    The attribute name.

  #### Returns number

  , The attribute value

### removeVertex

- removeVertex(feature: Feature<Geometry>, vertexInfo: number[]): void

- - Defined in src/misc/FeatureHelper.js:924

  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

- setProjection(projection: Projection): void

- - Defined in src/misc/FeatureHelper.js:215

  #### Parameters

  - ##### projection: Projection

    Projection.

  #### Returns void

### setStyle

- setStyle(feature: Feature<Geometry>, opt_select: boolean): void

- - Defined in src/misc/FeatureHelper.js:229

  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_

- supportsVertexRemoval_(feature: Feature<Geometry>): boolean

- - Defined in src/misc/FeatureHelper.js:1021

  #### 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_

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

- - Defined in src/misc/FeatureHelper.js:1004

  #### Parameters

  - ##### feature: Feature<Geometry>

    Feature.

  #### Returns boolean

  Whether the feature supports vertex or not.

Generated using TypeDoc