Skip to content

Core map APIs: basemap switching, zoom, and pointer-event streams - #237

Open
CarsonDavis wants to merge 1 commit into
developmentfrom
feat/mapcontrol-core
Open

Core map APIs: basemap switching, zoom, and pointer-event streams#237
CarsonDavis wants to merge 1 commit into
developmentfrom
feat/mapcontrol-core

Conversation

@CarsonDavis

Copy link
Copy Markdown
Collaborator

Description

First half of the split of #115 (MapControl plugin, by @BhattaraiSijan) — the core/engine capabilities, with the plugin itself following in a stacked PR. Split so the reusable core API surface gets reviewed on its own terms, separate from the ~1,200 lines of plugin UI that consume it. Content is @BhattaraiSijan's work rebased onto current development (44 commits ahead of #115's base, no conflicts); commits are attributed to the original author.

Part of #98.

New map:* bus handlers + documented mmgisAPI methods

Added in Map_.js and exposed on mmgisAPI, usable by any plugin:

  • setBasemap / getBasemap / getBasemapStyles — switch between named basemap styles. Styles come from msv.basemap.styles[] in the mission config, falling back to per-engine provider defaults (Leaflet → raster XYZ tile templates, deck.gl → vector style JSON).
  • zoomIn / zoomOut — clamped to the engine's min/max zoom.
  • latLngToContainerPoint — project {lat, lng} to container pixels, for positioning DOM overlays.
  • map:click / map:mousemove pointer streams re-emitted onto the event bus.

Engine adapters

  • LeafletAdapter gains runtime basemap rendering (it previously had none): mapbox:// styles resolve to Mapbox raster tile URLs (requires an access token), raw {z}/{x}/{y} templates render directly, and GL style URLs are skipped with a warning rather than silently rendering the wrong thing.
  • Behavior fix worth calling out: LeafletAdapter.createLayer now replaces an existing layer on a duplicate id instead of orphaning the old layer on the map with no registry entry left to remove it by.
  • DeckGLAdapter gains setStyle (swaps the vector style in place) and normalized {lat, lng} pointer-event emission.
  • view.ts gains BasemapStyleEntry and extends basemap config/docs to cover both engines.

Configure page

  • Basemap configuration now applies to any engine (was deck.gl-only); field descriptions updated to match.
  • New Earth missions get a default continental-US view; switching engines in the new-mission modal clears the basemap fields so values entered for one engine don't silently ship with another.

Differences from #115 (this portion)

  • Dropped two stale auto-version-bump package.json hunks (that workflow was removed in Stop auto-bumping the project version on every pull request #225) and three formatting-only reflow hunks (mmgisAPI.js ×2, DeckGLAdapter.ts ×1) with zero semantic change.
  • One comment in Map_.js reworded to not name the MapControl plugin, which only lands in the stacked PR.

Testing

  • Full unit suite passes on this branch (889 tests, vitest run).
  • npm run build succeeds on this branch standing alone.
  • Manual verification steps for the whole feature are in Feat/mapcontrol plugin #115; the plugin PR stacked on this one exercises every API added here.

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