Situation (Point Symbols)¶
SituationLayer draws categorical or uniform point
markers. Polygon geometries are automatically converted to centroids.
from mappyng import Map, BasemapLayer, SituationLayer
m = Map(gdf, width=800, height="auto")
m.add(BasemapLayer())
# Categorical markers
m.add(SituationLayer(
gdf_pts,
column="type",
symbol={
"Hospital": {"marker": "cross", "fill": "#e63946", "size": 12},
"School": {"marker": "square", "fill": "#457b9d", "size": 10},
"Park": {"marker": "circle", "fill": "#2a9d8f", "size": 9,
"fill_opacity": 0.8},
},
legend={"title": "Facilities", "columns_n": 2, "col_gap": 30},
))
# Uniform marker
m.add(SituationLayer(gdf_pts, marker="star", fill="#f4a261", size=14))
# Composite marker
m.add(SituationLayer(
gdf_pts,
marker="circle+cross",
fill="#264653",
inner_fill="#ffffff",
size=12,
))
# Custom SVG icon
m.add(SituationLayer(gdf_pts, marker="icons/hospital.svg", size=16))
Layer parameters¶
Key |
Default |
Description |
|---|---|---|
|
|
Categorical column (multi-symbol mode). Omit for uniform mode. |
|
|
|
|
|
Shape name (uniform mode or default for categories without an explicit entry). Built-in: Composite: Custom SVG: path to a |
|
|
Fill color (uniform mode). |
|
8.0 |
Marker size in SVG px (uniform mode). |
|
|
Stroke color (uniform mode). |
|
0.5 |
Stroke width (SVG px). |
|
1.0 |
Fill opacity 0-1. |
|
|
Fill for inner shape in composite markers. |
|
|
Stroke for inner shape in composite markers. |
|
|
Legend label text (uniform mode). |
|
|
Render on zoom viewport. |
|
|
Render on cartouche viewports. |
|
|
Legend sub-config dict. See table below. |
Legend parameters (legend sub-dict)¶
Shared fields: see the choropleth guide (shared fields table under “Legend parameters”).
Situation-specific fields¶
Key |
Default |
Description |
|---|---|---|
|
10.0 |
Marker preview size in the legend (SVG px). |
|
6.0 |
Gap between marker preview and label text (SVG px). |
|
4.0 |
Vertical gap between legend rows (SVG px). |
|
1 |
Number of legend columns. |
|
20.0 |
Horizontal gap between columns (SVG px). |