Skip to content

Add compare-layer and add-layer-from-URL entry points to the Layer Manager - #335

Open
sandesh-sp wants to merge 2 commits into
developmentfrom
feat/layer-manager-update
Open

Add compare-layer and add-layer-from-URL entry points to the Layer Manager#335
sandesh-sp wants to merge 2 commits into
developmentfrom
feat/layer-manager-update

Conversation

@sandesh-sp

Copy link
Copy Markdown
Collaborator

Two additions to the Layer Manager panel, both wired to other plugins over the mmgisAPI bus rather than through direct imports.

Compare layer

Each layer's three-dots menu gains a Compare layer entry. Choosing it hands that layer to the Comparison plugin as the first of the two sides it reads against each other. The hand-off is announced as a bus event, so the layers list knows nothing about Comparison beyond the event name, and a mission without that plugin simply has nobody listening.

Add layer from URL

A button above the layer list reveals the AddTempLayer plugin's "add layer from URL" form. AddTempLayer is configured startHidden and ships no trigger of its own, so something else has to reveal it; the button emits core:showPlugin to have the layout unhide the panel, alongside the plugin's own documented addTempLayer:show event for layouts that do not dispatch core commands. Both are inert in a mission without AddTempLayer, and the button itself is omitted whenever the host passes no handler — the portable LayerManagerPanel owns no form of its own.

AddTempLayer's manifest also drops its compatiblePositions list. The runtime reads placement metadata only from the mission config's tool entry, and a stale left/right list there caused the explicit assignment to the float-top-right panel to be rejected as incompatible, dropping the tool into the first left panel instead. With no position constraint declared, it is compatible with any panel and preferredPosition: "float-top-right" still steers the fallback.

Testing

npx vitest run src/essence/Tools/LayerManager/__tests__/ — 106 passing, including new cases covering the compare hand-off, the add-layer callback, and the button's absence without a handler. tsc --noEmit is clean.

Each layer's three-dots menu offers "Compare layer", which hands that layer
to the Comparison plugin as the first of the two sides it reads against each
other.

The hand-off is announced on the mmgisAPI bus rather than called directly:
the layers list knows nothing about Comparison beyond the name of the event,
and a mission without that plugin simply has nobody listening.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants