Commit 392266a
authored
Per-layer styling, picker toggle, resizable panel, dark-mode icon fix (#3)
* Add per-layer styling, picker toggle, panel resize, dark-mode icon fix
- Each theme now expands to its individual source layers; every layer has
its own visibility checkbox, color picker, and opacity slider, with a
theme master checkbox that reflects indeterminate state. State moves to
a per-layer model (OvertureLayerState) and new setLayer*/setThemeExpanded
methods drive the map sources/layers
- Add an "Inspect features on click" checkbox to enable/disable the picker
at runtime (setInspect); inspect state is part of OvertureMapsState
- Make the panel width drag-resizable; the handle sits on the edge away
from the anchored corner so it works at top-left and top-right alike
- Fix the toggle icon contrast in dark mode by raising the control
background specificity above maplibre's default white control group
* Reorder themes and replace the plugin icon
- Reorder the theme panel to Addresses, Places, Transportation, Buildings,
Divisions, Base (top to bottom). Layers are inserted with a beforeId so
the first listed theme always draws on top of the map regardless of the
order layers are toggled, keeping detail themes above the base background.
- Replace the stacked-layers toggle icon with a folded-map icon to avoid
visual confusion with other layer controls.
* Use overlapping-circles icon for the plugin toggle
Replace the folded-map icon (which collided with other plugins) with three
overlapping ring outlines echoing the Overture Maps brand motif. Distinct
from the default MapLibre layer, globe, and compass controls, with good
contrast in light and dark modes.
* Add a per-layer style editor button (color, size, opacity)
Replace the fixed per-layer color swatch with a style button that opens an
inline editor exposing the layer's color, size (circle radius for points,
line width for lines and polygon outlines), and opacity. Adds a `size`
field to the layer state, threads it through the spec builders, and adds
`setLayerSize` plus `sizePropertyForLayerType` / `defaultSizeForGeometry`
helpers. A small read-only color swatch stays on the collapsed row as a
preview.
* Address CodeRabbit review feedback
- Clarify the exported-types list in the README: ReleasesResponse is main
entry only and OvertureMapsControlReactProps is React entry only, rather
than implying every type is exported from both
- Add a :focus-visible outline to the per-layer color input so keyboard
users get a visible focus ring
* Add per-layer GeoJSON export of features in the current view
Add a download button to each layer row that exports the features rendered
in the current map view to a GeoJSON file. The export is gated by a new
exportMinZoom option (default 12) so it only ever covers a small area, and
the button is disabled when the layer is hidden. Features are deduplicated
across tile boundaries. Adds public exportLayer and getRenderedLayerGeoJSON
methods and a transient panel notice for export feedback.
* Follow the system color scheme live in auto theme mode
In auto mode, resolve the color scheme from prefers-color-scheme and apply
it as an explicit ovt-theme-light/dark class, and subscribe to a matchMedia
listener so the panel, container, and newly created popups adapt live when
the OS theme changes (not just at load). The CSS media query remains as a
fallback.
* Address CodeRabbit review feedback
- Lowercase the SVG stroke keyword (currentColor -> currentcolor) for the
style/export buttons to satisfy stylelint value-keyword-case
- Make the export notice an aria-live region (role=status, aria-live,
aria-atomic) and hide it via a CSS :empty rule instead of display
toggling so screen readers announce export feedback
- Coalesce exportMinZoom against the default in exportLayer so passing
exportMinZoom: undefined cannot bypass the zoom gate
- Align the exportMinZoom README description with the feature list wording1 parent 56d67d1 commit 392266a
9 files changed
Lines changed: 1626 additions & 174 deletions
File tree
- src
- lib
- core
- hooks
- styles
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
| 140 | + | |
138 | 141 | | |
139 | 142 | | |
140 | 143 | | |
| |||
144 | 147 | | |
145 | 148 | | |
146 | 149 | | |
147 | | - | |
148 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
149 | 160 | | |
150 | 161 | | |
151 | 162 | | |
| |||
191 | 202 | | |
192 | 203 | | |
193 | 204 | | |
194 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
195 | 208 | | |
196 | 209 | | |
197 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
| |||
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
| 39 | + | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
| |||
0 commit comments