Core map APIs: basemap switching, zoom, and pointer-event streams - #237
Open
CarsonDavis wants to merge 1 commit into
Open
Core map APIs: basemap switching, zoom, and pointer-event streams#237CarsonDavis wants to merge 1 commit into
CarsonDavis wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 + documentedmmgisAPImethodsAdded in
Map_.jsand exposed onmmgisAPI, usable by any plugin:setBasemap/getBasemap/getBasemapStyles— switch between named basemap styles. Styles come frommsv.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:mousemovepointer streams re-emitted onto the event bus.Engine adapters
LeafletAdaptergains 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.LeafletAdapter.createLayernow 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.DeckGLAdaptergainssetStyle(swaps the vector style in place) and normalized{lat, lng}pointer-event emission.view.tsgainsBasemapStyleEntryand extends basemap config/docs to cover both engines.Configure page
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)
package.jsonhunks (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.Map_.jsreworded to not name the MapControl plugin, which only lands in the stacked PR.Testing
vitest run).npm run buildsucceeds on this branch standing alone.