Skip to content

LayerOverlay

Namespace: ThinkGeo.Core

This class represents a group of layers; each layer can be of any layer type.

public class LayerOverlay : TileOverlay, System.IDisposable

Inheritance ObjectOverlayTileOverlayLayerOverlay
Implements IDisposable

Remarks:

This class represents a group of layers; each layer can be of any layer type.

Properties

IsEmpty

This property indicates whether this overlay is empty or not.

public bool IsEmpty { get; }

Property Value

Boolean

Layers

Gets a GeoCollection that contains the layers that will draw on the image.

public GeoCollection<Layer> Layers { get; }

Property Value

GeoCollection<Layer>
A GeoCollection of layers.

Remarks:

The Layers property holds all of the layers that are used by the Draw method. The Draw method loops through all layers to filter out features and draw on the image with the specified styles.

ImageFormat

Gets and sets drawing format for the tiles.

public RasterTileFormat ImageFormat { get; set; }

Property Value

RasterTileFormat

JpegQuality

Gets or sets the image quality when the TileImageFormat is Jpeg; otherwise this property has no effects. Its default value is 80.

public int JpegQuality { get; set; }

Property Value

Int32

IsCacheOnly

Gets or sets a value indicating whether this instance is cache only.

public bool IsCacheOnly { get; set; }

Property Value

Boolean
true if this instance is cache only; otherwise, false.

IsVisible

Gets or sets if this overlay is visible.

public bool IsVisible { get; set; }

Property Value

Boolean

DrawingQuality

public DrawingQuality DrawingQuality { get; set; }

Property Value

DrawingQuality

TileSizeMode

Gets or sets the tile size mode.

public TileSizeMode TileSizeMode { get; set; }

Property Value

TileSizeMode

        The tile size mode.

TileResolution

Gets or sets the tile resolution.

public TileResolution TileResolution { get; set; }

Property Value

TileResolution

        The tile resolution.

TileType

Gets and sets the overlay is formed by multiple tiles or single tile.

public TileType TileType { get; set; }

Property Value

TileType

TileWidth

Gets and sets the width of the tile.

public int TileWidth { get; set; }

Property Value

Int32

TileHeight

Gets and sets the height of the tile.

public int TileHeight { get; set; }

Property Value

Int32

TileCache

Gets and sets a tile cache object for saving the tiles.

public RasterTileCache TileCache { get; set; }

Property Value

RasterTileCache

TileSnappingMode

Gets or sets the tileView snapping mode.

public TileSnappingMode TileSnappingMode { get; set; }

Property Value

TileSnappingMode

TileBuffer

This property gets and sets the number of extra rows and colums of tiles on each side which will surround the minimum grid tiles to cover the map.

public int TileBuffer { get; set; }

Property Value

Int32

MaxExtent

This property gets or sets the max extent of matrix to calculate the tiles.

public RectangleShape MaxExtent { get; set; }

Property Value

RectangleShape

Remarks:

By default, MaxExtent is null; the matrix is created depending on the GeographyUnit of current map. When it's DecimalDegree, the matrix' is calculated as (-180, 90, 180, -90) as MaxExtent. While it's not DecimalDegree, the matrix is (-20037508.2314698, 20037508.2314698, 20037508.2314698, -20037508.2314698); It's allowed to modify it to customize the matrix.

WrappingMode

Thie property gets or sets whether allow wrap date line.

public WrappingMode WrappingMode { get; set; }

Property Value

WrappingMode

WrappingExtent

public RectangleShape WrappingExtent { get; set; }

Property Value

RectangleShape

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

RefreshTypeOnResize

public OverlayRefreshType RefreshTypeOnResize { get; set; }

Property Value

OverlayRefreshType

Attribution

public string Attribution { get; set; }

Property Value

String

AutoRefreshInterval

public TimeSpan AutoRefreshInterval { get; set; }

Property Value

TimeSpan

Constructors

LayerOverlay()

Constructor of LayerOverlay class.

public LayerOverlay()

LayerOverlay(IEnumerable<Layer>)

Constructor of LayerOverlay class.

public LayerOverlay(IEnumerable<Layer> layers)

Parameters

layers IEnumerable<Layer>
This parameter indicates a layer collection which needs to be drawn.

Methods

RefreshCore(RectangleShape)

protected void RefreshCore(RectangleShape extent)

Parameters

extent RectangleShape

RefreshAsyncCore(RectangleShape, CancellationToken)

protected Task RefreshAsyncCore(RectangleShape extent, CancellationToken cancellationToken)

Parameters

extent RectangleShape

cancellationToken CancellationToken

Returns

Task

OnTileTypeChanged(TileTypeChangedTileOverlayEventArgs)

protected void OnTileTypeChanged(TileTypeChangedTileOverlayEventArgs e)

Parameters

e TileTypeChangedTileOverlayEventArgs

Dispose(Boolean)

protected void Dispose(bool disposing)

Parameters

disposing Boolean

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.

GetTileCore()

This method gets a specific tile object to form an overlay.

protected TileView GetTileCore()

Returns

TileView
A TileView object to form an overlay.

DrawCore(RectangleShape, OverlayRefreshType)

protected void DrawCore(RectangleShape targetExtent, OverlayRefreshType overlayRefreshType)

Parameters

targetExtent RectangleShape

overlayRefreshType OverlayRefreshType

DrawAsyncCore(RectangleShape, OverlayRefreshType, CancellationToken)

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

Parameters

targetExtent RectangleShape

overlayRefreshType OverlayRefreshType

cancellationToken CancellationToken

Returns

Task

DrawExceptionCore(GeoCanvas, Exception)

protected void DrawExceptionCore(GeoCanvas canvas, Exception e)

Parameters

canvas GeoCanvas

e Exception

GetBoundingBoxCore()

This method gets a bounding box that holds all the layers which are added in this overlay.

protected RectangleShape GetBoundingBoxCore()

Returns

RectangleShape
A RectangleShape value that holds all the layers which are added in this overlay.

CloseAsyncCore()

protected Task CloseAsyncCore()

Returns

Task

OpenAsyncCore()

protected Task OpenAsyncCore()

Returns

Task

OnDrawingExceptionModeChanged()

internal void OnDrawingExceptionModeChanged()

PrefillDataToTilesCore(IEnumerable<TileView>)

protected void PrefillDataToTilesCore(IEnumerable<TileView> tiles)

Parameters

tiles IEnumerable<TileView>

Events

DrawTilesProgressChanged

This event raises when download progress is changed.

public event EventHandler<DrawTilesProgressChangedTileOverlayEventArgs> DrawTilesProgressChanged;

DrawingTile

This event raises before the tile is drawing.

public event EventHandler<DrawingTileTileOverlayEventArgs> DrawingTile;

DrawnTile

This event raises after the tile is drawn.

public event EventHandler<DrawnTileTileOverlayEventArgs> DrawnTile;

DrawingException

public event EventHandler<DrawingExceptionTileOverlayEventArgs> DrawingException;

DrawnException

public event EventHandler<DrawnExceptionTileOverlayEventArgs> DrawnException;

TileTypeChanged

public event EventHandler<TileTypeChangedTileOverlayEventArgs> TileTypeChanged;

TileTypeChanging

public event EventHandler<TileTypeChangingTileOverlayEventArgs> TileTypeChanging;

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;