new FeatureList( [options] [, features])
Parameters:
| Name | Type | Argument | Default | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Properties
|
||||||||||||||||||||||||||
features |
Array.<ol.Feature> | ol.Collection.<ol.Feature> | ol.source.Vector |
<optional> |
a set of feature to display. If provided as Source or Collection the features will stay in sync. |
||||||||||||||||||||||||||
options.pageLength |
number |
<optional> |
100 | number of row to display in the table (page optimzation) |
Fires:
- event:select
- event:dblclick
- event:collapse
- event:resize
- event:sort
Extends
Methods
-
_findInPage(feature)
-
Find a feature in the current page
Parameters:
Name Type Description featureol.Feature Returns:
- Type
- Object
-
_getLi(f)
-
Get the list element
Parameters:
Name Type Description fol.Feature Returns:
- Type
- Element
-
addButton(options, className [, title] [, html], click)
-
Add a button to the list header menu
Parameters:
Name Type Argument Description optionsObject classNamestring titlestring <optional>
htmlstring <optional>
clickfunction on click function
Returns:
- Type
- Element
-
collapse( [b])
-
Collapse the table
Parameters:
Name Type Argument Description bboolean <optional>
if no parameters toggle it
-
enableSort(propName)
-
Enable sort list by properties in the header
Parameters:
Name Type Argument Description propNamestring <repeatable>
-
formatProperty(feature,, prop)
-
Format feature property
Parameters:
Name Type Description feature,ol.Feature propstring property name
-
getColumns( [features])
-
Get the list of columns
Parameters:
Name Type Argument Description featuresArray.<ol.Feature> <optional>
a list of features to retrieve columns (if none, returns columns defined by setColumns)
-
getRowHeight()
-
Get height of a row
Returns:
- Type
- number
-
getSelection()
-
Get the current selection in the list
Returns:
- Type
- ol.Feature
-
getSort()
-
Get sorted properties list
Returns:
Object
-
isCollapsed()
-
Is the control collapsed
-
refresh( [force])
-
Refresh the list draw + resize use update if features have changed
Parameters:
Name Type Argument Description forceboolean <optional>
-
resetSort()
-
Reset all sorts
-
resize( [height])
-
Resize the control to the map
Parameters:
Name Type Argument Description heightnumber <optional>
the table height (if in a map sticks to the viewport height)
-
scrollTo(feature)
-
Scroll to an element / feature
Parameters:
Name Type Description featureol.Feature | string a featue or
selectto scroll at the selected row -
select( [feature] [, noScroll])
-
Select a feature in the list
Parameters:
Name Type Argument Default Description featureol.Feature <optional>
if none remove selection
noScrollboolean <optional>
false prevent scrolling to the selected row
-
setBottomScroll(b)
-
Scroll resize at botton
Parameters:
Name Type Description bboolean -
setColumns(columns)
-
Set the list of columns to display
Parameters:
Name Type Description columnsArray.<string> -
setFeatures(source)
-
Set the features list
Parameters:
Name Type Description sourceol.source.Vector | ol.Collection.<ol.Feature> | Array.<ol.Feature> a vector source or a collection of features to list
-
setMap(map)
-
Set the map instance the control is associated with and add its controls associated to this map.
Parameters:
Name Type Description mapol.Map The map instance.
-
sort( [silent])
-
Sort features in the table
Parameters:
Name Type Argument Description silentboolean <optional>
sort without triggering an event
-
sortBy(prop [, sort])
-
Sort list by properties
Parameters:
Name Type Argument Description propstring property name
sortstring <optional>
'up' or 'down', default remove sort
-
sortFn(f1, f2, prop)
-
A sort function to compare 2 properties
Parameters:
Name Type Description f1ol.Feature f2ol.Feature propstring property name to sort at
Returns:
number -1: v1 < v2, 1: v1 > v2, 0: v1 = v2
-
update()
-
Update the list (when features have changed without dispatching event).
-
updateFeature(feature)
-
Update a feature line in the table (attribute changed)
Parameters:
Name Type Description featureol.Feature Returns:
- Type
- boolean