Class: PointMarkerLayer

PointMarkerLayer(properties)

new PointMarkerLayer(properties)

Create the PointMarker
Parameters:
Name Type Description
properties Object
Properties
Name Type Attributes Default Description
location Array.<Number> [x,y,z]
orientation Number <optional>
0 -
icon String -
iconScale String <optional>
1 the icon scale size
iconColor String <optional>
"#000000" the icon color
iconAnchor Array.<Number> <optional>
[16,16] -
iconSize Array.<Number> <optional>
[16,16] -
label String -
labelColor String <optional>
"#000000" HTML color
labelSize Number <optional>
16 -
labelOffset Array.<Number> <optional>
[0,0] -
zIndex= Number <optional>
z-ordering of markers
getLocation function <optional>
-
getDescription function <optional>
-
getOrientation function <optional>
-
getIcon function <optional>
-
getIconColor function <optional>
-
getIconScale function <optional>
-
getLabel function <optional>
-
getLabelColor function <optional>
-
getLabelSize function <optional>
-
getZindex function <optional>
z-ordering of markers
onLeftClick function <optional>
trigger onLeftClick marker event
onRightClick function <optional>
trigger onRightClick marker event
onHover function <optional>
trigger onHover marker event
getMarkerId function <optional>
map an id to a unique marker
zoomLevel Number <optional>
15 Set the default zoom level
defaultToTerrainElevation Boolean <optional>
false Set the default to terrain elevation
Source:
Example
import PointMarkerLayer from 'core/ui/layer/PointMarkerLayer.js';

let pointMarkerLayer = new PointMarkerLayer({
        location : {
            x : 1.42376557,
            y : 43.61758626,
            z : 100
        },
        getLocation : {
            dataSourceIds : [androidPhoneGpsDataSource.getId()],
            handler : function(rec) {
                return {
                    x : rec.lon,
                    y : rec.lat,
                    z : rec.alt
                };
            }
        },
        getOrientation : {
            dataSourceIds : [androidPhoneOrientationDataSource.getId()],
            handler : function(rec) {
                return {
                    heading : rec.heading
                };
            }
        },
        icon : 'images/cameralook.png',
        getIcon : {
            dataSourceIds: [androidPhoneGpsDataSource.getId()],
            handler : function(rec,timeStamp,options) {
                if(options.selected) {
                    return 'images/cameralook-selected.png'
                } else {
                    return 'images/cameralook.png';
                };
            }
        }
    });

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: