ol-ishare/search

Classes

AddressSearch
LayerSearch

Methods

(inner) layerSearchForLayer(layer, options) → {module:ol-ishare/search~LayerSearch}

Creates a LayerSearch instance for a given ol-ishare overlay layers (ol/layer/Image~ImageLayer). Reads iShare layerName and searchField (if present) from the layer's Profile config.

import { layerSearchForLayer } from 'ol-ishare/search';
Parameters:
Name Type Description
layer ol/layer/Image~ImageLayer

overlay layer to create a LayerSearch instance for

options Object

Options passed to LayerSearch constructor. Commonly only the srs option is set (as it can't be determined from the layer). Options override layer properties.

Properties
Name Type Description
layerName String

Name of layer to search

searchField String

Name of field to search (required if not set in the Profile)

srs String

EPSG code of the search results defaults to EPSG:27700 (British National Grid)

formatResult function

Function called with feature argument (of type ol/Feature~Feature), expected to return a string that will be displayed to the user

maxFeatures Number

Maximum number of features to return from the server

Returns:

LayerSearch instance

Type
module:ol-ishare/search~LayerSearch