Class IsolineScene
Prepared isolines for repeated drawing in screen space: the viewer draws a scene every frame through a Mapsui style renderer, and the headless composite draws it once. Lines are dashed and labelled in screen pixels, so the dash and label spacing stay constant at every zoom. When land areas are supplied the lines are clipped to water (issue #483; R-101-104-B).
public sealed class IsolineScene : IDisposable
- Inheritance
-
IsolineScene
- Implements
- Inherited Members
Remarks
Geometry is held relative to an origin inside the scene so single-precision path coordinates keep sub-metre precision; each draw maps it to the screen with one affine matrix.
Constructors
IsolineScene(IReadOnlyList<IsolinePolyline>, IsolineAppearance, IReadOnlyList<FeatureGeometry>?)
Builds a scene from lines, clipped against
landAreas when given.
public IsolineScene(IReadOnlyList<IsolinePolyline> lines, IsolineAppearance appearance, IReadOnlyList<FeatureGeometry>? landAreas = null)
Parameters
linesIReadOnlyList<IsolinePolyline>The isolines.
appearanceIsolineAppearanceHow to draw them.
landAreasIReadOnlyList<FeatureGeometry>Land-area surfaces in WGS84 to clip the lines out of, or null to draw them everywhere.
Properties
Appearance
How the scene is drawn.
public IsolineAppearance Appearance { get; }
Property Value
IsEmpty
Whether the scene has no lines.
public bool IsEmpty { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Draw(SKCanvas, Func<double, double, SKPoint>, float, bool)
Draws the lines (and, unless drawLabels is false, the
labels) onto canvas.
public void Draw(SKCanvas canvas, Func<double, double, SKPoint> mercatorToScreen, float opacity = 1, bool drawLabels = true)
Parameters
canvasSKCanvasThe canvas, in screen pixels.
mercatorToScreenFunc<double, double, SKPoint>Projects Web Mercator metres to screen pixels.
opacityfloatOverall opacity, 0 to 1.
drawLabelsboolWhether to draw the labels with the lines.
DrawLabelsRotated(SKCanvas, Func<double, double, SKPoint>, double, float, float, SKRect)
Draws only the labels, each at its anchor turned by
rotationDegrees about
(centerX, centerY) and kept upright.
Used by the headless composite on a rotated display, which draws the lines
north-up and rotates them as an image.
public void DrawLabelsRotated(SKCanvas canvas, Func<double, double, SKPoint> mercatorToScreen, double rotationDegrees, float centerX, float centerY, SKRect cullBounds)
Parameters
canvasSKCanvasThe canvas, in screen pixels.
mercatorToScreenFunc<double, double, SKPoint>Projects Web Mercator metres to north-up screen pixels.
rotationDegreesdoubleDisplay rotation, clockwise.
centerXfloatRotation centre X.
centerYfloatRotation centre Y.
cullBoundsSKRectLabels whose turned anchor falls outside are skipped.