Class: GeoPointsCesiumPointsConnector

GeoPointsCesiumPointsConnector()

This connector keeps a CesiumVectorData model in sync with the points in a GeoPoints collection. This connector will listen for changes to the GeoPoints collection and update the cesiumModel with point entities created from the points in the collection.

Constructor

new GeoPointsCesiumPointsConnector()

Since:
  • 2.27.0
Source:

Extends

Members

type :string

The type of Backbone.Model this is.
Type:
  • string
Overrides:
Default Value:
  • "GeoPointsCesiumPointsConnector"
Source:

Methods

addAllLayerPoints() → {Boolean}

Add all points from the points collection to the layer.
Source:
Returns:
Whether the layer points were added
Type
Boolean

addLayerPoint(model) → {Cesium.Entity}

Add a point from the points collection to the layer. Adds the point entity to the layerPoints array for tracking.
Parameters:
Name Type Description
model GeoPoint The point model to add to the layer
Source:
Returns:
The layer point that was created
Type
Cesium.Entity

connect()

Listen for changes to the Points collection and update the CesiumVectorData model with point entities.
Inherited From:
Source:

defaults() → {Object}

Extends the default Backbone.Model.defaults() function to specify default attributes for the GeoPointsCesiumPointsConnector model.
Properties:
Name Type Description
layerPoints Array The list of point entities that have been added to the layer.
Overrides:
Source:
Returns:
The default attributes
Type
Object

disconnect()

Stop listening for changes to the Points collection.
Inherited From:
Source:

handleCollectionChange(eventName, collection, options)

Handle add, remove, merge, and reset events from the points collection
Parameters:
Name Type Description
eventName "update" | "reset" The name of the event
collection GeoPoints The points collection
options Object Options for the event, as passed by Backbone
Overrides:
Source:

initialize(attrs)

Initialize the model.
Parameters:
Name Type Attributes Description
attrs Object The attributes for this model.
attributes.geoPoints GeoPoints | Array <optional>
The GeoPoints collection to use for this connector or an array of JSON attributes to create a new GeoPoints collection. If not provided, a new empty GeoPoints collection will be created.
attributes.layer CesiumVectorData | Object <optional>
The CesiumVectorData CesiumVectorData model to use for this connector or a JSON object with options to create a model. If not provided, a new layer will be created.
Inherited From:
Source:

removeAllLayerPoints() → {Boolean}

Remove all layer points previously added to the layer.
Source:
Returns:
Whether the layer points were removed
Type
Boolean

removeLayerPoint(model) → {Cesium.Entity}

Remove a point from the points collection from the layer. Removes the point entity from the layerPoints array.
Parameters:
Name Type Description
model GeoPoint The point model to remove from the layer
Source:
Returns:
The layer point that was removed
Type
Cesium.Entity

resetLayerPoints()

Resync the layer points with the points from the points collection. This removes all point entities previously added to the layer and adds new ones for each point in the points collection.
Source:

setGeoPoints(pointsopt) → {GeoPoints}

Set or create and set the GeoPoints collection for this connector.
Parameters:
Name Type Attributes Description
points GeoPoints | Object <optional>
The GeoPoints collection to use for this connector or an array of JSON attributes to create points.
Inherited From:
Source:
Returns:
The GeoPoints collection for this connector.
Type
GeoPoints

setLayer(layeropt) → {CesiumVectorData}

Set or create and set the CesiumVectorData model for this connector.
Parameters:
Name Type Attributes Description
layer CesiumVectorData | Object <optional>
The CesiumVectorData model to use for this connector or a JSON object with options to create a new CesiumVectorData model. If not provided, a new CesiumVectorData model will be created.
Inherited From:
Source:
Returns:
The CesiumVectorData model for this connector.
Type
CesiumVectorData