Constructor
new PolygonLayer(properties)
Creates the PolygonLayer
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
properties |
Object |
Properties
|
- Source:
Example
import PolygonLayer from 'core/ui/layer/PolygonLayer.js';
let boundedDrapingLayer = new PolygonLayer({
getVertices : {
dataSourceIds: [boundsDatasource.getId()],
handler: (rec) => {
return [
rec.ulc.lon,
rec.ulc.lat,
rec.urc.lon,
rec.urc.lat,
rec.llc.lon,
rec.llc.lat,
rec.lrc.lon,
rec.lrc.lat,
];
}
},
});
Extends
Methods
addFn(dataSourceIds, fn, firstopt)
Adds a function associated to a list of dataSource ids
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
dataSourceIds |
Array.<String> | the list of datasources | ||
fn |
function | the function to add | ||
first |
Boolean |
<optional> |
false | set at the first position |
- Overrides:
- Source:
clear()
Clear the layer.
- Overrides:
- Source:
getDataSourcesIds() → {Array.<String>}
- Overrides:
- Source:
Returns:
The list of dataSource ids
- Type
- Array.<String>
getId() → {String}
Gets the layer id.
- Overrides:
- Source:
Returns:
the layer id
- Type
- String
getProps() → {Object}
Clone current layer properties
- Overrides:
- Source:
Returns:
a shallow copy of current properties
- Type
- Object
init()
Inits the layer.
- Overrides:
- Source:
reset()
Reset to default Layer values
- Overrides:
- Source:
select(dataSourceIds)
Selects the datasource contained into the list
Parameters:
Name | Type | Description |
---|---|---|
dataSourceIds |
Array | the list of datasources |
- Overrides:
- Source:
(async) setData(dataSourceId, records, options)
Parameters:
Name | Type | Description |
---|---|---|
dataSourceId |
||
records |
Array.<Object> | |
options |
- Overrides:
- Source: