Skip to content

AdornmentOverlay

Namespace: ThinkGeo.UI.WebApi

Adornment layers - a legend, a scale line or bar, a north arrow, a logo - drawn into one transparent image of the map's size, for the browser to lay over the map. A Web API action takes the map's size and extent from the browser and returns Overlay.GetImageAsync(int, int, RectangleShape, CancellationToken); the browser asks again when the view settles, so a scale line always says the scale shown.

public class AdornmentOverlay : Overlay

Inheritance object → Overlay → AdornmentOverlay

Properties

Layers

The adornment layers, drawn in order.

public GeoCollection<AdornmentLayer> Layers { get; }

Property Value

GeoCollection<AdornmentLayer>

Id

The name the overlay's route goes by, given when it was made.

public string Id { get; }

Property Value

string

IsVisible

Whether the overlay draws. Hidden, it draws nothing and its images are transparent.

public bool IsVisible { get; set; }

Property Value

bool

MapUnit

The unit of the coordinates the overlay is drawn in: meters for web mercator, what a browser map is in and the default; decimal degrees for data left in longitude and latitude. The extents handed to the overlay are read in it, a tile grid follows it, and so does a scale line.

public GeographyUnit MapUnit { get; set; }

Property Value

GeographyUnit

DrawingExceptionMode

What happens when drawing fails: the exception is thrown to the action, drawn into the image as a marked tile so the map still comes up, both (the default), or ignored.

public DrawingExceptionMode DrawingExceptionMode { get; set; }

Property Value

DrawingExceptionMode

Constructors

AdornmentOverlay()

Creates an overlay with a generated id.

public AdornmentOverlay()

AdornmentOverlay(string)

Creates an overlay under an id: the name its route goes by.

public AdornmentOverlay(string id)

Parameters

id string
The name the application knows the overlay by.

Methods

DrawAsyncCore(GeoCanvas, CancellationToken)

Draws every visible layer onto the canvas; a layer that is not safe to draw from two requests at once draws one request at a time.

protected Task DrawAsyncCore(GeoCanvas geoCanvas, CancellationToken cancellationToken)

Parameters

geoCanvas GeoCanvas
The canvas to draw onto.

cancellationToken CancellationToken
The request's token.

Returns

Task

Events

Drawing

Raised before the overlay draws; a handler can cancel the draw.

public event EventHandler<DrawingOverlayEventArgs> Drawing;

Drawn

Raised after the overlay has drawn.

public event EventHandler<DrawnOverlayEventArgs> Drawn;