Skip to content

LayerOverlay

Namespace: ThinkGeo.UI.WebApi

Represents an overlay that draws a collection of layers and exposes events for the drawing lifecycle. Implements the Overlay

public class LayerOverlay : Overlay

Inheritance ObjectOverlayLayerOverlay

Properties

Layers

Gets the live collection of layers that will be drawn by this overlay.

public GeoCollection<LayerBase> Layers { get; }

Property Value

GeoCollection<LayerBase>
A mutable collection of instances.

TileCache

Gets or sets the cache used to persist rendered tiles between requests.

public RasterTileCache TileCache { get; set; }

Property Value

RasterTileCache
The tile cache implementation that backs this overlay, or null to render on demand.

TileWidth

Gets or sets the tile width in pixels.

public int TileWidth { get; set; }

Property Value

Int32
Tile width in pixels; defaults to 512.

TileHeight

Gets or sets the tile height in pixels.

public int TileHeight { get; set; }

Property Value

Int32
Tile height in pixels; defaults to 512.

Id

Gets the identifier that external callers can use to reference this overlay.

public string Id { get; }

Property Value

String
Overlay identifier supplied at construction.

IsVisible

Gets or sets a value indicating whether this overlay participates in draw requests.

public bool IsVisible { get; set; }

Property Value

Boolean
true when the overlay should render; otherwise, false.

DrawingExceptionMode

Gets or sets the strategy used when an exception occurs while drawing.

public DrawingExceptionMode DrawingExceptionMode { get; set; }

Property Value

DrawingExceptionMode
One of the values.

Constructors

LayerOverlay()

Creates an overlay with a generated identifier and an initially empty LayerOverlay.Layers collection.

public LayerOverlay()

LayerOverlay(String)

Creates an overlay that uses the specified identifier and starts with an empty LayerOverlay.Layers collection.

public LayerOverlay(string id)

Parameters

id String
Stable identifier exposed to callers.

LayerOverlay(IEnumerable<LayerBase>)

Creates an overlay that automatically generates an identifier and seeds the overlay with the provided layers.

public LayerOverlay(IEnumerable<LayerBase> layers)

Parameters

layers IEnumerable<LayerBase>
Layers that will be added to the overlay in the supplied order.

LayerOverlay(String, IEnumerable<LayerBase>)

Creates an overlay that draws the supplied layers using the provided identifier.

public LayerOverlay(string id, IEnumerable<LayerBase> layers)

Parameters

id String
Stable identifier exposed to callers.

layers IEnumerable<LayerBase>
Layers that will be added to the overlay in the supplied order.

Methods

DrawCore(GeoCanvas)

Draws the overlay, optionally using cached tiles when a LayerOverlay.TileCache is configured.

protected void DrawCore(GeoCanvas geoCanvas)

Parameters

geoCanvas GeoCanvas
Destination canvas for the overlay output.

OnDrawingLayer(DrawingLayerOverlayEventArgs)

Raises the LayerOverlay.DrawingLayer event so subscribers can inspect or cancel the layer draw operation.

protected void OnDrawingLayer(DrawingLayerOverlayEventArgs e)

Parameters

e DrawingLayerOverlayEventArgs
Event data describing the layer that is about to be drawn.

OnDrawnLayer(DrawnLayerOverlayEventArgs)

Raises the LayerOverlay.DrawnLayer event so subscribers can react after a layer has been rendered.

protected void OnDrawnLayer(DrawnLayerOverlayEventArgs e)

Parameters

e DrawnLayerOverlayEventArgs
Event data describing the layer that has completed drawing.

Events

DrawingLayer

Raised before an individual layer in the overlay begins drawing.

public event EventHandler<DrawingLayerOverlayEventArgs> DrawingLayer;

DrawnLayer

Raised after an individual layer in the overlay finishes drawing.

public event EventHandler<DrawnLayerOverlayEventArgs> DrawnLayer;

Drawing

Raised before the overlay begins drawing.

public event EventHandler<DrawingOverlayEventArgs> Drawing;

Drawn

Raised after the overlay finishes drawing.

public event EventHandler<DrawnOverlayEventArgs> Drawn;