Class: PolylineLayer

PolylineLayer(properties)

new PolylineLayer(properties)

Creates the PolylineLayer
Parameters:
Name Type Description
properties Object
Properties
Name Type Attributes Default Description
locations Array.<Object> <optional>
defines the default location of the polyline [lat, lon]
weight Number <optional>
1 defines the weight of the polyline
color String <optional>
'red' defines the color of the polyline
opacity Number <optional>
1 defines the opacity of the polyline
smoothFactor Number <optional>
1 defines the smoothFactor of the polyline
maxPoints Number <optional>
10 defines a number max of points
clampToGround Boolean <optional>
false defines if the line has to be clamped to ground
getLocation function <optional>
defines a function to return the location
getColor function <optional>
defines a function to return the color
getWeight function <optional>
defines a function to return the weight
getOpacity function <optional>
defines a function to return the opacity
getSmoothFactor function <optional>
defines a function to return the smoothFactor
getPolylineId function <optional>
map an id to a unique polyline
Source:
Example
import PolylineLayer from 'core/ui/layer/PolylineLayer.js';

let polylineLayer = new PolylineLayer({
		getLocation : {
			dataSourceIds : [datasource.getId()],
			handler : function(rec) {
				return {
					x : rec.lon,
					y : rec.lat,
					z : rec.alt
				};
			}
		},
		color : 'rgba(0,0,255,0.5)',
		weight : 10,
		opacity : .5,
		smoothFactor : 1,
		maxPoints : 200
	});

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: