LeafletDragPoints

LeafletDragPoints

new LeafletDragPoints(terria, pointMovedCallback)

Source:

For letting user drag existing points in Leaflet ViewerMode only.

Parameters:
Name Type Description
terria Terria

The Terria instance.

pointMovedCallback PointMovedCallback

A function that is called when a point is moved.

Members

_draggableObjects :CustomDataSource

Source:

List of entities that can be dragged, which is populated with user-created points only.

Type:

_dragInProgress :Bool

Source:

Whether user is currently dragging point.

Type:
  • Bool

_pointMovedCallback :PointMovedCallback

Source:
Default Value:
  • undefined

Callback that occurs when point is moved. Function takes a CustomDataSource which is a list of PointEntities.

Type:

dragCount :Number

Source:

For determining whether a drag has just occurred, to avoid deleting a point at the end of the drag.

Type:
  • Number

Methods

_onMouseDownOnPoint(entity)

Source:

Function that is called when the user clicks and holds on a point that was previously drawn.

Parameters:
Name Type Description
entity Entity

The entity that user mouse downs on.

_onMouseMove(move)

Source:

Function that is called when the mouse moves.

Parameters:
Name Type Description
move Leaflet.MouseEvent

Information about the move such as the final position of the mouse.

_onMouseUp(e)

Source:

Function that is called when the user releases the mousedown click.

Parameters:
Name Type Description
e Leaflet.MouseEvent

Information about where the event occurred.

destroy()

Source:

A clean up function to call when destroying the object.

setUp()

Source:

Set up the drag point helper so that attempting to drag a point will move the point.

updateDraggableObjects(entities)

Source:

Update the list of draggable objects with a new list of entities that are able to be dragged. We are only interested in entities that the user has drawn.

Parameters:
Name Type Description
entities CustomDataSource

Entities that user has drawn on the map.