Class: module:Group

ngeo.datasource.module:Group.ngeo.datasource.module:Group

new module:Group(options)

A Group data source combines multiple ngeo.datasource.DataSource objects. Its main purpose is to provide a calculated visibilityState property that can be used to determine if all its data source are all visible, all hidden or some are hidden and other visible.

Parameters:
Name Type Description
options ngeox.datasource.GroupOptions

Options.

Members

dataSources

dataSourcesCollection

(protected, non-null) dataSourcesCollection_: ol.Collection:.<!ngeo.datasource.DataSource:>

title

visibilityState

Methods

addDataSource(dataSource)

Parameters:
Name Type Description
dataSource !ngeo.datasource.DataSource

Data source to add.

destroy()

getDataSourceState(dataSource)

Parameters:
Name Type Description
dataSource !ngeo.datasource.DataSource

Data source.

Returns:
string

Visible state of a data source

removeDataSource(dataSource)

Parameters:
Name Type Description
dataSource !ngeo.datasource.DataSource

Data source to remove.

toggleVisibilityState()

Update visible property of all data sources depending on the current visibility state:

  • state ON --> visible false
  • state OFF --> visible true
  • state IND. --> visible true