Class: EllipseLayer

EllipseLayer(properties)

new EllipseLayer(properties)

Creates the EllipseLayer
Parameters:
Name Type Description
properties Object
Properties
Name Type Attributes Default Description
position Array.<Object> <optional>
defines the default location of the ellipse [lat, lon, alt]
semiMajorAxis Number <optional>
null defines the semi-major axis of the ellipse
semiMinorAxis Number <optional>
null defines the semi-minor axis of the ellipse
rotation Number <optional>
null defines the rotation of the ellipse counter-clockwise from north.
clampToGround Boolean <optional>
false defines if the line has to be clamped to ground
color String <optional>
'red' defines the color property of the ellipse
getPosition function <optional>
defines a function to return the location
getColor function <optional>
defines a function to return the color
getSemiMajorAxis function <optional>
defines a function to return the semiMajorAxis
getSemiMinorAxis function <optional>
defines a function to return the semiMinorAxis
getHeight function <optional>
defines a function to return the height of the ellipse above the ellipsoid
getRotation function <optional>
defines a function to return the rotation of the ellipse
getEllipseID function <optional>
map an id to a unique ellipse
Source:
Example
import EllipseLayer from 'osh-js/core/ui/layer/EllipseLayer';

let ellipse = new EllipseLayer({
        dataSourceId: gpsDataSource.id,
        getPosition: (rec) => ({
            x: rec.location.lon,
            y: rec.location.lat,
            z: rec.location.alt
        }),
        color: 'rgba(255,74,22, 0.5)',
        semiMinorAxis: 100,
        semiMajorAxis: 200,
        name: "Android Phone GPS Path"
    });

Extends

Methods

addFn(dataSourceIds, fn)

Adds a function associated to a list of dataSource ids
Parameters:
Name Type Description
dataSourceIds Array.<String> the list of datasources
fn function the function to add
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:

setData(dataSourceId, records, options)

Parameters:
Name Type Description
dataSourceId
records Array.<Object>
options
Overrides:
Source: