Skip to content

TrackInteractiveOverlay

Namespace: ThinkGeo.Core

This class inherits from InterativeOverlay abstract class. This specified overlay describle the TrackShape interative process with MapControl using Mouse or Keyborad.

public class TrackInteractiveOverlay : InteractiveOverlay, System.IDisposable

Inheritance ObjectOverlayInteractiveOverlayTrackInteractiveOverlay
Implements IDisposable

Properties

IsEmpty

This property override the logic in its base class by watching the feature count in trackShapeLayer.

If it is empty ,we can skip drawing it for better performance.

public bool IsEmpty { get; }

Property Value

Boolean

TrackShapeLayer

This property gets the TrackShape layers which holds the track shapes.

public InMemoryFeatureLayer TrackShapeLayer { get; }

Property Value

InMemoryFeatureLayer

TrackShapesInProcessLayer

public InMemoryFeatureLayer TrackShapesInProcessLayer { get; }

Property Value

InMemoryFeatureLayer

VertexCountInQuarter

public int VertexCountInQuarter { get; set; }

Property Value

Int32

PolygonTrackMode

public PolygonTrackMode PolygonTrackMode { get; set; }

Property Value

PolygonTrackMode

TrackMode

Gets a mode of TrackOverlay.

public TrackMode TrackMode { get; set; }

Property Value

TrackMode
A mode of TrackOverlay.

Remarks:

The default mode is TrackMode.None which means you cannot draw or edit features. By setting the mode to TrackMode.Point, TrackMode.Line, TrackMode.Polygon etc., you could add point, line or polygon to the FeatureOverlay. Setting the mode to TrackMode.Edit, you could edit the shapes.

DrawingMarginPercentage

This property gets and sets the extra drawing margin as a percentage around the map that draw to ensure that labeling is correct.

public double DrawingMarginPercentage { get; set; }

Property Value

Double

        This property gets the extra drawing margin as a percentage around the map that
        draws to ensure that labeling is correct.

Remarks:

This extra margin that we draw exists so that labels match up if they are partially cut off.

CanRefreshRegion

public bool CanRefreshRegion { get; protected set; }

Property Value

Boolean

IsBase

public bool IsBase { get; set; }

Property Value

Boolean

Name

Gets or sets the name of this overaly.

public string Name { get; set; }

Property Value

String

MapArguments

Gets or sets current map information which will be used for calculating mechanism.

public MapArguments MapArguments { get; set; }

Property Value

MapArguments

OverlayCanvas

Gets or sets the actual canvas which maintains all the visual elements on the overlay.

public Canvas OverlayCanvas { get; set; }

Property Value

Canvas

DrawingExceptionMode

This property gets and sets the DrawingExceptionMode used when an exception occurs during drawing.

public DrawingExceptionMode DrawingExceptionMode { get; set; }

Property Value

DrawingExceptionMode

IsVisible

Gets or sets if this overlay is visible.

public bool IsVisible { get; set; }

Property Value

Boolean

Attribution

public string Attribution { get; set; }

Property Value

String

AutoRefreshInterval

public TimeSpan AutoRefreshInterval { get; set; }

Property Value

TimeSpan

Constructors

TrackInteractiveOverlay()

Default constructor of the class.

If you use this constructor, please set the properties correctly or it will use their default values.

public TrackInteractiveOverlay()

Methods

InitializeCore(MapArguments)

protected void InitializeCore(MapArguments mapArguments)

Parameters

mapArguments MapArguments

OpenAsyncCore()

protected Task OpenAsyncCore()

Returns

Task

EndTracking()

This method ends the tracking shape by initialize some variables.

protected void EndTracking()

MouseDownCore(InteractionArguments)

This overrides the MouseDown logic in its base class InterativeOverlay.

protected InteractiveResult MouseDownCore(InteractionArguments interactionArguments)

Parameters

interactionArguments InteractionArguments
This parameter is the interaction auguments for the method.

Returns

InteractiveResult
Interaction results of this method.

Exceptions

ArgumentNullException
If you pass a null as the interactionArguments, we will throw an ArgumentNullException.

MouseMoveCore(InteractionArguments)

This overrides the MouseMove logic in its base class InterativeOverlay.

protected InteractiveResult MouseMoveCore(InteractionArguments interactionArguments)

Parameters

interactionArguments InteractionArguments
This parameter is the interaction auguments for the method.

Returns

InteractiveResult
Interaction results of this method.

Exceptions

ArgumentNullException
If you pass a null as the interactionArguments, we will throw an ArgumentNullException.

MouseUpCore(InteractionArguments)

This overrides the MouseUp logic in its base class InterativeOverlay.

protected InteractiveResult MouseUpCore(InteractionArguments interactionArguments)

Parameters

interactionArguments InteractionArguments
This parameter is the interaction auguments for the method.

Returns

InteractiveResult
Interaction results of this method.

Exceptions

ArgumentNullException
If you pass a null as the interactionArguments, we will throw an ArgumentNullException.

MouseClickCore(InteractionArguments)

This overrides the MouseClick logic in its base class.

protected InteractiveResult MouseClickCore(InteractionArguments interactionArguments)

Parameters

interactionArguments InteractionArguments
This parameter is the interaction auguments for the method.

Returns

InteractiveResult
Interaction results of this method.

Exceptions

ArgumentNullException
If you pass a null as the interactionArguments, we will throw an ArgumentNullException.

MouseDoubleClickCore(InteractionArguments)

This overrides the MouseDoubleClick logic in its base class InterativeOverlay.

protected InteractiveResult MouseDoubleClickCore(InteractionArguments interactionArguments)

Parameters

interactionArguments InteractionArguments
This parameter is the interaction auguments for the method.

Returns

InteractiveResult
Interaction results of this method.

Exceptions

ArgumentNullException
If you pass a null as the interactionArguments, we will throw an ArgumentNullException.

GetTrackingShape()

This method gets the current Tracking shape.

public BaseShape GetTrackingShape()

Returns

BaseShape
Returns a shape represents the current status of tracking shape.

Remarks:

This method is the concrete wrapper for the abstract method GetTrackingShapeCore. This method draws the representation of the overlay based on the extent you provided.

GetTrackingShapeCore()

This is the Core method of GetTrackingShape.You could overrides this method to have your own logic. This method gets the current Tracking shape.

protected BaseShape GetTrackingShapeCore()

Returns

BaseShape
Returns a shape represents the current status of tracking shape.

OnTrackEnded(TrackEndedTrackInteractiveOverlayEventArgs)

This event will be fired after the end of Tracking a shape.

protected void OnTrackEnded(TrackEndedTrackInteractiveOverlayEventArgs e)

Parameters

e TrackEndedTrackInteractiveOverlayEventArgs
The TrackEndedTrackInteractiveOverlayEventArgs passed for the event raised.

OnTrackEnding(TrackEndingTrackInteractiveOverlayEventArgs)

This event will be fired before the end of Tracking a shape.

protected void OnTrackEnding(TrackEndingTrackInteractiveOverlayEventArgs e)

Parameters

e TrackEndingTrackInteractiveOverlayEventArgs
The TrackEndingTrackInteractiveOverlayEventArgs passed for the event raised.

OnTrackStarting(TrackStartingTrackInteractiveOverlayEventArgs)

This event will be fired before the start of Tracking a shape.

protected void OnTrackStarting(TrackStartingTrackInteractiveOverlayEventArgs e)

Parameters

e TrackStartingTrackInteractiveOverlayEventArgs
The TrackStartingTrackInteractiveOverlayEventArgs passed for the event raised.

OnTrackStarted(TrackStartedTrackInteractiveOverlayEventArgs)

This event will be fired after the start of Tracking a shape.

protected void OnTrackStarted(TrackStartedTrackInteractiveOverlayEventArgs e)

Parameters

e TrackStartedTrackInteractiveOverlayEventArgs
The TrackStartedTrackInteractiveOverlayEventArgs passed for the event raised.

OnVertexAdding(VertexAddingTrackInteractiveOverlayEventArgs)

This event will be fired before adding a vertex to the Tracking shape.

protected void OnVertexAdding(VertexAddingTrackInteractiveOverlayEventArgs e)

Parameters

e VertexAddingTrackInteractiveOverlayEventArgs
The VertexAddingTrackInteractiveOverlayEventArgs passed for the event raised.

OnVertexAdded(VertexAddedTrackInteractiveOverlayEventArgs)

This event will be fired after adding a vertex to the Tracking shape.

protected void OnVertexAdded(VertexAddedTrackInteractiveOverlayEventArgs e)

Parameters

e VertexAddedTrackInteractiveOverlayEventArgs
The VertexAddedTrackInteractiveOverlayEventArgs passed for the event raised.

OnMouseMoved(MouseMovedTrackInteractiveOverlayEventArgs)

This event will be fired when mouse moved a vertex to the Tracking shape.

protected void OnMouseMoved(MouseMovedTrackInteractiveOverlayEventArgs e)

Parameters

e MouseMovedTrackInteractiveOverlayEventArgs
The MouseMovedTrackInteractiveOverlayEventArgs passed for the event raised.

ManipulationStartedCore(InteractionArguments)

protected InteractiveResult ManipulationStartedCore(InteractionArguments interactionArguments)

Parameters

interactionArguments InteractionArguments

Returns

InteractiveResult

ManipulationDeltaCore(InteractionArguments)

protected InteractiveResult ManipulationDeltaCore(InteractionArguments interactionArguments)

Parameters

interactionArguments InteractionArguments

Returns

InteractiveResult

ManipulationCompletedCore(InteractionArguments)

protected InteractiveResult ManipulationCompletedCore(InteractionArguments interactionArguments)

Parameters

interactionArguments InteractionArguments

Returns

InteractiveResult

DrawAsyncCore(RectangleShape, OverlayRefreshType, CancellationToken)

protected Task DrawAsyncCore(RectangleShape targetExtent, OverlayRefreshType overlayRefreshType, CancellationToken cancellationToken)

Parameters

targetExtent RectangleShape

overlayRefreshType OverlayRefreshType

cancellationToken CancellationToken

Returns

Task

DrawTileAsyncCore(GeoCanvas)

This methods draws tracking shapes on the map.

protected Task DrawTileAsyncCore(GeoCanvas geoCanvas)

Parameters

geoCanvas GeoCanvas
The drawing context for drawing shapes.

Returns

Task

SaveStateCore()

This method saves overlay state to a byte array.

protected Byte[] SaveStateCore()

Returns

Byte[]
A byte array indicates current overlay state.

LoadStateCore(Byte[])

This method restore the overlay state back from the specified state.

protected void LoadStateCore(Byte[] state)

Parameters

state Byte[]
This parameter indicates the state for restore the overlay.

Dispose(Boolean)

This method disposes unmanaged resourece in this object.

protected void Dispose(bool disposing)

Parameters

disposing Boolean

WriteTrackShapeLayer()

protected bool WriteTrackShapeLayer()

Returns

Boolean

Events

TrackEnded

This event will be fired after the end of tracking shape.

public event EventHandler<TrackEndedTrackInteractiveOverlayEventArgs> TrackEnded;

TrackEnding

This event will be fired before the end of tracking shape.

public event EventHandler<TrackEndingTrackInteractiveOverlayEventArgs> TrackEnding;

TrackStarted

This event will be fired after the start of tracking shape.

public event EventHandler<TrackStartedTrackInteractiveOverlayEventArgs> TrackStarted;

TrackStarting

This event will be fired before the start of tracking shape.

public event EventHandler<TrackStartingTrackInteractiveOverlayEventArgs> TrackStarting;

VertexAdded

This event will be fired after a vertex added to the tracking shape.

public event EventHandler<VertexAddedTrackInteractiveOverlayEventArgs> VertexAdded;

VertexAdding

This event will be fired before a vertex added to the tracking shape.

public event EventHandler<VertexAddingTrackInteractiveOverlayEventArgs> VertexAdding;

MouseMoved

This event will be fired when mouse moved on the vertex of tracking shape.

public event EventHandler<MouseMovedTrackInteractiveOverlayEventArgs> MouseMoved;

MapMouseDown

This event will be fired when Mouse pressed Down on the Map.

public event EventHandler<MapMouseDownInteractiveOverlayEventArgs> MapMouseDown;

MapMouseMove

This event will be fired when Mouse moved on the Map.

public event EventHandler<MapMouseMoveInteractiveOverlayEventArgs> MapMouseMove;

MapMouseUp

This event will be fired when Mouse released up on the Map.

public event EventHandler<MapMouseUpInteractiveOverlayEventArgs> MapMouseUp;

MapMouseClick

This event will be fired when Mouse clicked(mouse up and mouse down in the same postion) on the Map.

public event EventHandler<MapMouseClickInteractiveOverlayEventArgs> MapMouseClick;

MapMouseDoubleClick

This event will be fired when Mouse double clicked on the Map.

public event EventHandler<MapMouseDoubleClickInteractiveOverlayEventArgs> MapMouseDoubleClick;

MapMouseWheel

This event will be fired when Mouse wheel on the Map.

public event EventHandler<MapMouseWheelInteractiveOverlayEventArgs> MapMouseWheel;

MapMouseLeave

Occurs when mouse leave the map canvas.

public event EventHandler<MapMouseLeaveInteractiveOverlayEventArgs> MapMouseLeave;

MapMouseEnter

Occurs when mouse enter the map canvas.

public event EventHandler<MapMouseEnterInteractiveOverlayEventArgs> MapMouseEnter;

MapKeyDown

Occurs when key down on the map canvas.

public event EventHandler<MapKeyDownInteractiveOverlayEventArgs> MapKeyDown;

MapKeyUp

Occurs when key up on the map canvas.

public event EventHandler<MapKeyUpInteractiveOverlayEventArgs> MapKeyUp;

Drawing

This event raises before the overlay is drawing.

public event EventHandler<DrawingOverlayEventArgs> Drawing;

Drawn

This event raises after the overlay is drawn.

public event EventHandler<DrawnOverlayEventArgs> Drawn;

DrawingAttribution

public event EventHandler<DrawingAttributionOverlayEventArgs> DrawingAttribution;

DrawnAttribution

public event EventHandler<DrawnAttributionOverlayEventArgs> DrawnAttribution;

ThrowingException

public event EventHandler<ThrowingExceptionOverlayEventArgs> ThrowingException;