Skip to content

OverlayBase

Namespace: ThinkGeo.Core

This class is the base class of all overlays in this overlay system.

public abstract class OverlayBase : System.IDisposable

Inheritance ObjectOverlayBase
Implements IDisposable

Remarks:

The Overlay has the similar concept as the layer. Different types of overlays stack over each other to form a map. An overlay object is responsible for getting the configuration infomation from the user.

Usually an overlay represents an image with transparent background that is laid upon other overlay such as LayerOverlay, WmsOverlay. While the MarkerOverlay will not be rendered as an image, it is actually represents a control that holds bunch of marker images on the map.

Properties

Name

Gets or sets the name of this overaly.

public string Name { get; set; }

Property Value

String

DrawingExceptionMode

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

public DrawingExceptionMode DrawingExceptionMode { get; set; }

Property Value

DrawingExceptionMode
The drawing exception mode.

IsVisible

Gets or sets a value indicating whether this instance is visible.

public abstract bool IsVisible { get; set; }

Property Value

Boolean
true if this instance is visible; otherwise, false.

MapArguments

Gets or sets the map arguments.

public MapArguments MapArguments { get; set; }

Property Value

MapArguments
The map arguments.

Attribution

Gets or sets the attribution.

public string Attribution { get; set; }

Property Value

String
The attribution.

IsEmpty

Gets a value indicating whether this instance is empty.

public bool IsEmpty { get; }

Property Value

Boolean

Remarks:

This property enhances the performance of the overlay while drawing. If is true, we will skip drawing this overlay and continue drawing the next overlay.

DrawingQuality

Gets or sets the drawingQuality for this overlay.

public DrawingQuality DrawingQuality { get; set; }

Property Value

DrawingQuality

Opacity

Gets or sets the opacity for this overlay.

public double Opacity { get; set; }

Property Value

Double

Methods

CreateRenderingGeoCanvas()

protected GeoCanvas CreateRenderingGeoCanvas()

Returns

GeoCanvas

CreateRenderingGeoCanvasCore()

protected GeoCanvas CreateRenderingGeoCanvasCore()

Returns

GeoCanvas

GetBoundingBox()

This method gets a bounding box of the Overlay.

public RectangleShape GetBoundingBox()

Returns

RectangleShape
A RectangleShape indicating the bounding box of this overlay.

Remarks:

This method is the concrete wrapper for the abstract method GetBoundingBoxCore. This method returns the bounding box of the Overlay.

As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.

GetBoundingBoxCore()

This method returns the bounding box of the Overlay.

protected RectangleShape GetBoundingBoxCore()

Returns

RectangleShape
This method returns the bounding box of the Overlay.

Remarks:

This method returns the bounding box of the Overlay.

Initialize(MapArguments)

This method initializes overlay object.

public void Initialize(MapArguments mapArguments)

Parameters

mapArguments MapArguments
This parameter maintains current map information for calculating mechanism.

Remarks:

This is a wrapper method for the virtual method InitializeCore.

InitializeCore(MapArguments)

This method initializes overlay object.

protected void InitializeCore(MapArguments mapArguments)

Parameters

mapArguments MapArguments
This parameter maintains current map information for calculating mechanism.

Remarks:

When implementing this method, consider initializing the overlay canvas such as setting its z-index, setting current map reference to the CurrentMap property.

Refresh()

This method refreshes all the content in the OverlayCanvas. For example, LayerOverlay with multiple tiles; when the style of one layer is changed, call Refresh to refresh all the tiles to accept new styles.

public void Refresh()

Remarks:

The difference from Draw() method is that Refresh() method refreshes all the elements while Draw() does not.

RefreshCore()

This method refreshes all the content in the OverlayCanvas. For example, LayerOverlay with multiple tiles; when the style of one layer is changed, call Refresh to refresh all the tiles to accept new styles.

protected void RefreshCore()

Remarks:

The difference from Draw() method is that Refresh() method refreshs all the elements while Draw() does not.

Draw(MapArguments, OverlayRefreshType)

This method draws the overlay with the provided extent in world coordinate.

public void Draw(MapArguments mapArguments, OverlayRefreshType refreshType)

Parameters

mapArguments MapArguments
This parameter maintains current map information for calculating mechanism.

refreshType OverlayRefreshType

        This parameter indicates whether the elements of this overlay needs to be refreshed.
        For example, TileOverlay is formed by tiles.
        When panning the map around, the existing tile doesn't need to be redraw,
        the only thing we need to do is modifying the position of these tiles.
        On another hand, when click to change the style of the overlay,
        we need to redraw the tile images to change the appearance. So we need refresh mode.

DrawCore(MapArguments, OverlayRefreshType)

This method draws the overlay with the provided extent in world coordinate.

protected abstract void DrawCore(MapArguments mapArguments, OverlayRefreshType refreshType)

Parameters

mapArguments MapArguments
This parameter maintains current map information for calculating mechanism.

refreshType OverlayRefreshType

        This parameter indicates whether the elements of this overlay needs to be refreshed.
        For example, TileOverlay is formed by tiles.
        When panning the map around, the existing tile doesn't need to be redraw,
        the only thing we need to do is modifying the position of these tiles.
        On another hand, when click to change the style of the overlay,
        we need to redraw the tile images to change the appearance. So we need refresh mode.

DrawCoreAsync(MapArguments, OverlayRefreshType)

protected Task DrawCoreAsync(MapArguments mapArguments, OverlayRefreshType refreshType)

Parameters

mapArguments MapArguments

refreshType OverlayRefreshType

Returns

Task

DrawAsync(MapArguments, OverlayRefreshType)

public Task DrawAsync(MapArguments mapArguments, OverlayRefreshType refreshType)

Parameters

mapArguments MapArguments

refreshType OverlayRefreshType

Returns

Task

PostTransform(TransformArguments, MapArguments)

This method will simulate the PostTransform interaction.

public void PostTransform(TransformArguments transformInfo, MapArguments mapArguments)

Parameters

transformInfo TransformArguments
This parameter maintains the transfrom information for calculating transform.

mapArguments MapArguments
This parameter maintains current map information for calculating mechanism.

PostTransformCore(TransformArguments, MapArguments)

This protected virtual method is the Core method of PostTransform API.

protected void PostTransformCore(TransformArguments transformInfo, MapArguments mapArguments)

Parameters

transformInfo TransformArguments
This parameter maintains the transfrom information for calculating transform.

mapArguments MapArguments
This parameter maintains current map information for calculating mechanism.

StopAnimation()

public void StopAnimation()

StopAnimationCore()

protected void StopAnimationCore()

Open()

This method will simulate the Open interaction.

public void Open()

OpenCore()

This protected virtual method is the Core method of Open API.

protected void OpenCore()

Close()

Closes this instance.

public void Close()

CloseCore()

This protected virtual method is the Core method of Close API.

protected void CloseCore()

DrawException(GeoCanvas, Exception)

This method will draw on the canvas when the layer.Draw throw exception and the DrawExceptionMode is set to DrawException instead of ThrowException.

protected void DrawException(GeoCanvas geoCanvas, Exception exception)

Parameters

geoCanvas GeoCanvas
The target canvas to draw the layer.

exception Exception
The exception thrown when layer.Draw().

Remarks:

This method can be overriden its logic by rewrite the DrawExceptionCore.

DrawExceptionCore(GeoCanvas, Exception)

This method will draw on the canvas when the layer.Draw throw exception and the DrawExceptionMode is set to DrawException instead of ThrowException.

protected void DrawExceptionCore(GeoCanvas geoCanvas, Exception ex)

Parameters

geoCanvas GeoCanvas
The target canvas to draw the layer.

ex Exception
The exception thrown when layer.Draw().

OnDrawing(DrawingOverlayEventArgs)

This method raises before the overlay is drawing.

protected void OnDrawing(DrawingOverlayEventArgs e)

Parameters

e DrawingOverlayEventArgs
This parameter is the event argument for Drawing event.

OnDrawn(DrawnOverlayEventArgs)

This method raises after the overlay is drawn.

protected void OnDrawn(DrawnOverlayEventArgs e)

Parameters

e DrawnOverlayEventArgs
This parameter is the event argument for Drawn event.

OnDrawingException(DrawingExceptionOverlayEventArgs)

This method raises before the overlay is drawing exception.

protected void OnDrawingException(DrawingExceptionOverlayEventArgs args)

Parameters

args DrawingExceptionOverlayEventArgs
This parameter is the event argument for DrawingException event.

OnDrawnException(DrawnExceptionOverlayEventArgs)

This method raises after the overlay is drawn exception.

protected void OnDrawnException(DrawnExceptionOverlayEventArgs args)

Parameters

args DrawnExceptionOverlayEventArgs
This parameter is the event argument for DrawingException event.

Dispose()

This method dispose unmanaged resource used in this class.

public void Dispose()

Dispose(Boolean)

Releases unmanaged and - optionally - managed resources.

protected abstract void Dispose(bool disposing)

Parameters

disposing Boolean
true to release both managed and unmanaged resources; false to release only unmanaged resources.

Finalize()

protected void Finalize()

Events

DrawingException

Occurs before exception is drawing on map.

public event EventHandler<DrawingExceptionOverlayEventArgs> DrawingException;

DrawnException

Occurs after exception is drawn on map.

public event EventHandler<DrawnExceptionOverlayEventArgs> DrawnException;

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;