Module: ol/array


import * as olArray from 'ol/array';


stableSort(arr, compareFnc)

import {stableSort} from 'ol/array';

Sort the passed array such that the relative order of equal elements is preserved. See for details.

Name Type Description
arr Array.<*>

The array to sort (modifies original).

compareFnc function

Comparison function.

Type Definitions


getZForResolution can use a function of this type to determine which nearest resolution to use.

This function takes a {number} representing a value between two array entries, a {number} representing the value of the nearest higher entry and a {number} representing the value of the nearest lower entry as arguments and returns a {number}. If a negative number or zero is returned the lower value will be used, if a positive number is returned the higher value will be used.