Class: FeatureHash

ngeo.format.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.

Constructor

new FeatureHash([opt_options]opt)

Parameters:
Name Type Attributes Description
[opt_options] ngeox.format.FeatureHashOptions= <optional>

Options.

See:

Extends

Members

readFeature

readFeatures

readGeometry

writeFeature

writeFeatures

writeGeometry

Methods

(protected) readFeatureFromText(text, [opt_options]opt)

Read a feature from a logical sequence of characters.

Parameters:
Name Type Attributes Description
text string

Text.

[opt_options] olx.format.ReadOptions= <optional>

Read options.

Returns:
ol.Feature

Feature.

(protected) readFeaturesFromText(text, [opt_options]opt)

Read multiple features from a logical sequence of characters.

Parameters:
Name Type Attributes Description
text string

Text.

[opt_options] olx.format.ReadOptions= <optional>

Read options.

Returns:
Array.

Features.

(protected) readGeometryFromText(text, [opt_options]opt)

Read a geometry from a logical sequence of characters.

Parameters:
Name Type Attributes Description
text string

Text.

[opt_options] olx.format.ReadOptions= <optional>

Read options.

Returns:
ol.geom.Geometry

Geometry.

(protected) writeFeaturesText(features, [opt_options]opt)

Encode an array of features into a logical sequence of characters.

Parameters:
Name Type Attributes Description
features Array.

Feature.

[opt_options] olx.format.ReadOptions= <optional>

Read options.

Returns:
string

Encoded features.

(protected) writeFeatureText(feature, [opt_options]opt)

Encode a feature into a logical sequence of characters.

Parameters:
Name Type Attributes Description
feature ol.Feature

Feature.

[opt_options] olx.format.ReadOptions= <optional>

Read options.

Returns:
string

Encoded feature.

(protected) writeGeometryText(geometry, [opt_options]opt)

Encode a geometry into a logical sequence of characters.

Parameters:
Name Type Attributes Description
geometry ol.geom.Geometry

Geometry.

[opt_options] olx.format.ReadOptions= <optional>

Read options.

Returns:
string

Encoded geometry.