Repository navigation
Description
Share: exports and links show a comparison the way the screen does
Motivation
A user builds a comparison, two layers or two dates side by side or under a swipe, and wants to hand it to someone: a PNG for a slide, a PDF for a report, or a link for a colleague. Today none of the three carries the comparison. The PNG and PDF show the basemap with no data on it at all, the legend band under them lists layers nobody was looking at, and the link opens a plain map with both sides' layers stacked on top of each other. Every one of these succeeds without an error, so the person finds out only when they look at the file or the colleague opens the link.
How it should work
With comparison on, the Share button's actions produce what the screen shows:
- Export as PNG / PDF gives the map as seen: the left side left of the divider, the right side right of it, the divider at its dragged position, and both captions.
- The legend band under the image names the layers each side draws and the date each side is pinned to.
- Copy link gives a link that reopens the same comparison: layout, sides, dates and divider position.
With comparison off, nothing changes.
Done when
- A PNG and a PDF exported during a swipe or side-by-side comparison show both sides, the divider and the captions.
- The legend band under such an export lists only each side's layers, with that side's date.
- A link copied during a comparison reopens it as it was.
- An export or link made with comparison off is identical to what it is today.
Children
- Share: PNG and PDF exports capture both sides of a comparison, the divider and the captions #614 PNG and PDF exports capture both sides of a comparison, the divider and the captions (first)
- Share: the export legend band lists each side's layers with the date that side is pinned to #615 The export legend band lists each side's layers with the date that side is pinned to
- Share: the copied link reopens the comparison, sides, dates and divider included #616 The copied link reopens the comparison, sides, dates and divider included
Out of scope
- The Leaflet engine, which has no comparison mode.
- The Animation tool's exports.
- Editing a comparison from inside a link, or sharing one through the dashboard publish flow.
Draft implementation plan — written as of d34fa71 on 2026-11-05. Rough guide; re-verify against latest code.
Current behavior
- Comparison on deck.gl empties the primary map (
_syncLayersinDeckGLAdapter.tsgives it no layers while enabled) and draws each side in its own WebGL surface: two followerDecks clipped by CSS for swipe, two panes with their own basemap and overlay for side-by-side. The divider and captions are DOM nodes in the map container (MapComparison.js_createDivider). captureScreenshotreads only the primary canvas, so the image is basemap-only (overlay mode) or empty (standalone).- The export legend (
_shared/legend/getExportLegendModel.ts→getLayersWithLegends) takes visibility fromlayers:getVisible, which is the layer panel's on/off state; comparison never writes it. Per-side visibility at the pinned date lives only on the engine's cloned layer props (comparisonTimePins.ts). ComparisonTool.getUrlStringreturns an empty string andQueryURL.writeCoordinateURLhas a fixed key list with no comparison entry; nothing on load restores a comparison.
Where the change lands & rough plan
One child per piece; see each child's plan. Shared state is map:comparison:getState (MapComparison.js): { enabled, layout, dividerPosition, left: { layerIds, date, label }, right: {...} }.
References
- Research trace:
_ignore/research/2026-11-05-comparison-export-findings.md(local, not in the repo). src/essence/Basics/MapEngines/Adapters/DeckGLAdapter.ts,src/essence/Basics/Map_/MapComparison.js,src/essence/Tools/_shared/adapters/shareActions.ts,src/essence/Tools/_shared/legend/getExportLegendModel.ts,src/essence/Ancillary/QueryURL.js.
Activity