Skip to main content

Module layer

Module layer 

Source
Expand description

Custom layers: code that draws through a DrawContext (lines, fills, markers, labels in world or lon/lat coordinates) and, optionally, says which of its features are under a spot. Add one to a crate::Map with add_custom_layer for anything style layers can’t express, the way MapLibre’s CustomLayerInterface works.

Markers is a ready-made one for a list of Overlay markers and lines.

Structs§

DrawContext
What a layer draws into. Positions are braille dots relative to the map area (2 per column, 4 per row); helpers take world (Web Mercator 0..1) or lon/lat coordinates. Lines and fills draw immediately, in layer order; markers and labels are collected and placed after every layer, highest priority first, so they never overlap.
Markers
A list of Overlay markers and lines as a custom layer.
PickContext
Where to look for features: target is a dot position relative to area.

Constants§

REPEAT_DOTS
By default the same text isn’t placed again within this many braille dots (20 columns or 10 rows; a dot is about as tall as it is wide), so copies of one label from neighboring tiles merge.

Traits§

CustomLayer
Something drawn on the map by your own code.