Skip to content

PolygonLayer

Inherits: MapLayer

A layer to display PolygonMarkers.

Properties

Properties#

draw_labels_last #

draw_labels_last: bool = False

Whether to draw labels last and thus over all the polygons.

polygon_culling #

polygon_culling: bool = True

Whether to cull polygons and polygon sections that are outside of the viewport.

polygon_labels #

polygon_labels: bool = True

Whether to draw per-polygon labels.

polygons #

polygons: list[PolygonMarker]

A list of PolygonMarkers to display.

simplification_tolerance #

simplification_tolerance: Number = 0.3

The tolerance value used to simplify polygon outlines before rendering.

Higher values will result in polygons with fewer points, which can improve rendering performance at the cost of reduced geometric accuracy. Lower values preserve more detail but may decrease performance, especially with complex polygons.

Set to 0 to disable simplification.

use_alternative_rendering #

use_alternative_rendering: bool = False

Whether to use an alternative rendering pathway to draw polygons onto the underlying Canvas, which can be more performant in 'some' circumstances.

This will not always improve performance, and there are other important considerations before enabling it. It is intended for use when prior profiling indicates more performance is required after other methods are already in use. For example, it may worsen performance when there are a huge number of polygons to triangulate - and so this is best used in conjunction with simplification, not as a replacement.