feat(core): drawing primitives + overlay + bus surface on IMapEngine#90
Open
BhattaraiSijan wants to merge 6 commits into
Open
feat(core): drawing primitives + overlay + bus surface on IMapEngine#90BhattaraiSijan wants to merge 6 commits into
BhattaraiSijan wants to merge 6 commits into
Conversation
…-layers" This reverts commit 1c9b175.
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.
Adds to the core map engine + plugin bus. Consumed downstream by a follow-up AOI plugin PR
Drawing
IMapEngine: 4 methods (enableDrawing/disableDrawing/finishDrawing/isDrawing) + 4 events (drawstart/drawvertex/drawcomplete/drawcancel).types/events.ts: 6 types —DrawShape,DrawingOptions, and 4 event payload interfaces.leaflet-draw+ 2 helpers inLeafletHelpers.ts(leafletDrawnLayerToFeature,extractDrawVertices).DeckGLHelpers.ts(buildDrawnFeature,buildPreviewFeature, 32-segment circle approximation + haversine for radius).Anchored HTML overlays
IMapEngine: 2 methods (addOverlay/removeOverlay) + 1 type (OverlayOptions).L.marker+L.divIcon(reposition is native).move/moveend.Bus surface in
Map_.jsmap:getCenter/getBounds/getZoom/setView/fitBounds/panTo) fromMap_.map.*→engine.*so they're engine-agnostic.createLayer/removeLayer/hasLayer, wrapping pre-existing engine methods) + overlays (2).move/moveend.MapEngines/index.tsexports the new types.Follow-up: consumer plugin PR
The AOI plugin PR (
feat/draw-aoi-plugin) consumes this surface:mmgisAPI.request('map:enableDrawing', ...)for the draw flow.mmgisAPI.on('map:drawcomplete', ...)to receive the finalised feature.mmgisAPI.request('map:createLayer', ...)to render the selected AOI on the map.mmgisAPI.request('map:addOverlay', ...)for the action tooltip.No further core changes are required for that PR to ship.
Discussion
leaflet-draw. Maybe use library like terradraw for deck.gl drawing? Experimented with editable-layers, but it did not work.1c9b1751/40c0a899). Recommend squash-and-merge to keepdevelopment's log clean.Closes: #88
Test plan
feat/draw-aoi-plugin.map:addOverlay, removed viamap:removeOverlay.map:drawcompletepayload reaches a consumer plugin through the bus.npx tsc --noEmitexits 0.