Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FeatureHash

Provide an OpenLayers format for encoding and decoding features for use in permalinks.

The code is based on Stéphane Brunner's URLCompressed format.

TODOs:

  • The OpenLayers-URLCompressed format has options where the user can define attribute and style transformers. This is currently not supported by this format.
  • The OpenLayers-URLCompressed format has a "simplify" option. This format does not have it.
  • ol.style.Icon styles are not supported.
  • Transformation of coordinates during encoding and decoding is not supported.
see

https://github.com/sbrunner/OpenLayers-URLCompressed

Hierarchy

  • TextFeature
    • FeatureHash

Index

Constructors

constructor

  • new FeatureHash(opt_options: FeatureHashOptions): FeatureHash

Methods

decodeCoordinates_

  • decodeCoordinates_(text: string, opt_flatCoordinates: number[]): number[]
  • Read a logical sequence of characters and return (or complete then return) an array of numbers. The coordinates are assumed to be in two dimensions and in latitude, longitude order. corresponding to a geometry's coordinates.

    Parameters

    • text: string

      Text.

    • opt_flatCoordinates: number[]

      Flat coordinates array.

    Returns number[]

    Flat coordinates.

getType

  • getType(): any
  • abstract

    Returns any

    Format.

readFeature

  • readFeature(source: Document | Element | any | string, opt_options?: ReadOptions | undefined): FeatureLike
  • Read a single feature from a source.

    abstract

    Parameters

    • source: Document | Element | any | string

      Source.

    • Optional opt_options: ReadOptions | undefined

      Read options.

    Returns FeatureLike

    Feature.

readFeatures

  • readFeatures(source: Document | Element | ArrayBuffer | any | string, opt_options?: ReadOptions | undefined): Array<FeatureLike>
  • Read all features from a source.

    abstract

    Parameters

    • source: Document | Element | ArrayBuffer | any | string

      Source.

    • Optional opt_options: ReadOptions | undefined

      Read options.

    Returns Array<FeatureLike>

    Features.

readGeometry

  • readGeometry(source: Document | Element | any | string, opt_options?: ReadOptions | undefined): Geometry
  • Read a single geometry from a source.

    abstract

    Parameters

    • source: Document | Element | any | string

      Source.

    • Optional opt_options: ReadOptions | undefined

      Read options.

    Returns Geometry

    Geometry.

readProjection

  • readProjection(source: Document | Element | any | string): Projection
  • Read the projection from a source.

    abstract

    Parameters

    • source: Document | Element | any | string

      Source.

    Returns Projection

    Projection.

writeFeature

  • writeFeature(feature: any, opt_options?: WriteOptions | undefined): string
  • Encode a feature in this format.

    abstract

    Parameters

    • feature: any

      Feature.

    • Optional opt_options: WriteOptions | undefined

      Write options.

    Returns string

    Result.

writeFeatures

  • writeFeatures(features: Array<any>, opt_options?: WriteOptions | undefined): string
  • Encode an array of features in this format.

    abstract

    Parameters

    • features: Array<any>

      Features.

    • Optional opt_options: WriteOptions | undefined

      Write options.

    Returns string

    Result.

writeGeometry

  • writeGeometry(geometry: Geometry, opt_options?: WriteOptions | undefined): string
  • Write a single geometry in this format.

    abstract

    Parameters

    • geometry: Geometry

      Geometry.

    • Optional opt_options: WriteOptions | undefined

      Write options.

    Returns string

    Result.

Generated using TypeDoc