The "what can this map do for you?" button can now live IN a map's control column instead of floating over it. This is the bridge only: nothing changes until a map adds the control and its gallery tab sets trigger: 'control'. - map-controls/MapInfoButton.vue (new): a MapControlButton with the info icon and the localized mapInfo.open label. Clicking it sends a bubbling, composed 'dxmaps:mapinfo-open' event out of the plugin's shadow root to the gallery pane. On mount it asks 'dxmaps:mapinfo-control' and shows ONLY if a MapInfo on the same pane answers (ack), so a standalone leaf or a partner page never shows a button that opens nothing. A MapInfo that mounts later broadcasts 'dxmaps:mapinfo-host' and the button asks again. - info/MapInfo.vue: new prop trigger, 'floating' (default, unchanged) | 'control'. In control mode it listens on its own pane: it acts only on events whose composedPath contains the pane, and stops them there. Its own floating button and pointer hide ONLY while the announced control is MEASURED usable: connected, a non-zero on-screen rect, and in no inert/aria-hidden subtree. It is re-measured by IntersectionObserver and ResizeObserver plus a 1.5 s fallback timer, never inferred from an unmount event. Escape and close return focus to the control when it is on screen, else to the floating button. aria-expanded is kept on the control. Proved on a UPG-100 pilot served locally (gallery page, 1440, MapLibre and Mapbox, en and ar), exactly one info button on screen at every step: wall 1 floating; Map 1 control (it wins its hit test and sits inside the toolbar column); opened from the control, Escape closes it with focus back on the control; toolbar hidden 1 floating, shown again 1 control; tab away and back 1; back to the wall 1 floating. 0 page errors. That pilot's wiring is not in this commit. |
||
|---|---|---|
| .. | ||
| FullscreenButton.vue | ||
| GeocoderComponent.vue | ||
| HamburgerButton.vue | ||
| HelpButton.vue | ||
| index.js | ||
| LocationButton.vue | ||
| MapControlButton.vue | ||
| MapControlMenu.vue | ||
| MapInfoButton.vue | ||
| MapToolbar.vue | ||
| README.md | ||
| ShareButton.vue | ||
| ThemeToggleButton.vue | ||
| ZoomInButton.vue | ||
| ZoomOutButton.vue | ||
library/components/map-controls/ — toolbar buttons
Each file is a single, focused button or input that mounts inside the map's control area. Replaces
the older monolithic MapControlsComponent.vue.
MapToolbar.vue (container)
├─ ZoomInButton · ZoomOutButton · LocationButton
├─ FullscreenButton · HamburgerButton · ThemeToggleButton
├─ HelpButton · ShareButton
└─ GeocoderComponent (all built on MapControlButton.vue)
- Every button takes a
sizeprop (sm | md | lg) and follows theMapControlButtonshape. - Click handlers go through
inject('mapStore')orgetMap()— never a captured Mapbox instance. - To add one: copy
ZoomInButton.vueand register it inMapToolbar.vue.
Full conventions + catalog: ../../../documentation/architecture/components.md.