Class: CoPlanarPolygonLayer

CoPlanarPolygonLayer(properties)

This coplanar polygon layer class defines the constructs necessary to create render-able polygons

Constructor

new CoPlanarPolygonLayer(properties)

Creates the PolygonLayer
Parameters:
Name Type Description
properties Object
Properties
Name Type Attributes Default Description
vertices Array.<Number> <optional>
defines the default vertices as an array of lat, lon e.g. [lat0, lon0, alt0, lat1, lon2, alt1, ... , latN, lonN, altN,]
getVertices function <optional>
defines a function to return the vertices as an array of lat, lon e.g. [lat0, lon0, lat1, lon2, ... , latN, lonN]
outlineColor String <optional>
rgb(0,0,0) defines the weight of the polyline
outlineWidth Number <optional>
1 defines the weight of the polyline
color String <optional>
rgb(255,0,0) defines the color of the polyline
opacity Number <optional>
1 defines the opacity of the polyline
clampToGround Boolean <optional>
false defines if the line has to be clamped to ground
getColor function <optional>
defines a function to return the color
getOpacity function <optional>
defines a function to return the opacity
getOutlineColor function <optional>
defines a function to return the outline color
getOutlineWidth function <optional>
defines a function to return the outline width
getPolygonId function <optional>
map an id to a unique polygon
Source:
Example
import CoPlanarPolygonLayer from 'core/ui/layer/PolygonLayer.js';

 let boundedDrapingLayer = new PolygonLayer({
           getVertices : {
                dataSourceIds: [boundsDatasource.getId()],
                handler: (rec) => {
                    return [
                        rec.ulc.lon,
                        rec.ulc.lat,
                        rec.ulc.alt,
                        rec.urc.lon,
                        rec.urc.lat,
                        rec.ulc.alt,
                        rec.llc.lon,
                        rec.llc.lat,
                        rec.ulc.alt,
                        rec.lrc.lon,
                        rec.lrc.lat,
                        rec.ulc.alt,
                    ];
                }
            },
    });

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: