Home Reference Source Repository
import SortedFeatures from 'webmapsjs/src/olHelpers/SortedFeatures.js'
public class | source

SortedFeatures

take an array of features and sort by a given property name

Constructor Summary

Public Constructor
public

constructor(features: Array<ol.Feature>, propertyName: string)

Member Summary

Public Members
public
public

Method Summary

Public Methods
public

getFeature(propertyValue: number | string, exactMatch: boolean, sortedFeatures: Array): ol.Feature | undefined

recursive search to find the value

Public Constructors

public constructor(features: Array<ol.Feature>, propertyName: string) source

Params:

NameTypeAttributeDescription
features Array<ol.Feature>

array of ol features

propertyName string

the property name to use for lookup

Public Members

public propertyName: * source

public sortedFeatures: * source

Public Methods

public getFeature(propertyValue: number | string, exactMatch: boolean, sortedFeatures: Array): ol.Feature | undefined source

recursive search to find the value

Params:

NameTypeAttributeDescription
propertyValue number | string

the property value to search for

exactMatch boolean
  • optional
  • default: false

if only an exact match should be returned

sortedFeatures Array
  • optional
  • default: this.sortedFeatures

the candidate features

Return:

ol.Feature | undefined

the feature matching the lookup