UNPKG

@razi91/types-ol-ext

Version:
56 lines (52 loc) 2.08 kB
import { Map as _ol_Map_ } from 'ol'; import Collection from 'ol/Collection'; import Feature from 'ol/Feature'; import { Vector as VectorSource } from 'ol/source'; import SelectBase from './SelectBase'; export interface Options { className?: string; target?: Element ; source?: VectorSource | VectorSource[]; property?: string; label?: string; max?: number; selectAll?: number; type?: string; defaultLabel?: number; onchoice?: ((...params: any[]) => any); } /** * Select features by property using a popup * * @constructor * @extends {contrSelectBase} * @fires select * @param {Object=} options * @param {string} options.className control class name * @param {Element | undefined} options.target Specify a target if you want the control to be rendered outside of the map's viewport. * @param {Vector | Array<Vector>} options.source the source to search in * @param {string} options.property property to select on * @param {string} options.label control label * @param {number} options.max max feature to test to get the values, default 10000 * @param {number} options.selectAll select all features if no option selected * @param {string} options.type check type: checkbox or radio, default checkbox * @param {number} options.defaultLabel label for the default radio button * @param {function|undefined} options.onchoice function triggered when an option is clicked, default doSelect */ export default class SelectCheck extends SelectBase { constructor(options?: Options); /** * Set the map instance the control associated with. * @param {_ol_Map_} map The map instance. */ setMap(map: _ol_Map_): void; /** Set the popup values * @param {Object} options * @param {Object} options.values a key/value list with key = property value, value = title shown in the popup, default search values in the sources * @param {boolean} options.sort sort values */ setValues(options: { values?: { [key: string]: any; } sort?: boolean; }): void; }