Skip to content

feat: add point and line sketching to Draw on Map - #3639

Open
igorDykhta wants to merge 9 commits into
masterfrom
igr/draw-on-map-extend
Open

feat: add point and line sketching to Draw on Map#3639
igorDykhta wants to merge 9 commits into
masterfrom
igr/draw-on-map-extend

Conversation

@igorDykhta

@igorDykhta igorDykhta commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add Point and Line tools to Draw on Map, with copy-all (GeoJSON) and convert-to-layer for sketches.
  • Keep rectangles as spatial filters; polygons stay sketches until Filter Layers is applied. Points and lines cannot filter.
  • Improve editing (move whole lines, Escape returns to Select) and document the workflow.

Test plan

  • Draw points and lines; confirm they persist and stay in draw mode for multiple sketches
  • Drag a selected line by its body to move it; click the line to insert a vertex
  • Draw a rectangle and confirm it still filters layers; draw a polygon and apply Filter Layers from the context menu
  • Convert sketches to a layer and copy all as GeoJSON
  • Press Escape while drawing to return to Select
Screenshot 2026-08-15 at 8 59 40 PM Screenshot 2026-08-15 at 10 42 20 PM

Ihor Dykhta added 2 commits August 15, 2026 11:54
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Copilot AI lite review requested due to automatic review settings August 15, 2026 17:48
@igorDykhta igorDykhta changed the title feat: improve draw on map functionality feat: add point and line sketching to Draw on Map Aug 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands kepler.gl’s “Draw on Map” editor to support point/line sketches, improves editing/selection UX (including line translation), adds “copy all” and “convert sketches to layer” actions, and documents the workflow.

Changes:

  • Add point and line drawing modes, updated tooltips, selection behavior, and line-translation interaction improvements.
  • Add utilities + reducer/action support to copy sketches as GeoJSON and convert sketches into a new GeoJSON dataset/layer.
  • Add filter polygon visual differentiation + on-map filter badges, plus docs/i18n/test updates.

Reviewed changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/node/utils/index.js Registers the new editor feature util test suite.
test/node/utils/editor-utils-test.js Extends editor-layer utility coverage for new modes/tooltips/selection + styling.
test/node/utils/editor-feature-utils-test.js Adds unit tests for new editor feature conversion/sanitization helpers.
test/node/reducers/vis-state-test.js Adds reducer tests for sketch↔filter behavior and convert-to-layer action.
SUMMARY.md Adds “Draw on Map” to documentation navigation.
src/utils/src/index.ts Exports new editor feature utility module + types.
src/utils/src/editor-feature-utils.ts Implements sketch sanitization, FC conversion, filter→sketch conversion, and filter badge anchor selection.
src/reducers/src/vis-state.ts Wires new CONVERT_EDITOR_FEATURES_TO_LAYER action to updater.
src/reducers/src/vis-state-updaters.ts Implements convert-to-layer updater and sketch restoration when removing final filtered layer.
src/localization/src/translations/ru.ts Adds new Draw on Map tooltip/toolbar/editor strings (RU).
src/localization/src/translations/pt.ts Adds new Draw on Map tooltip/toolbar/editor strings (PT).
src/localization/src/translations/ja.ts Adds new Draw on Map tooltip/toolbar/editor strings (JA).
src/localization/src/translations/fi.ts Adds new Draw on Map tooltip/toolbar/editor strings (FI).
src/localization/src/translations/es.ts Adds new Draw on Map tooltip/toolbar/editor strings (ES).
src/localization/src/translations/en.ts Adds new Draw on Map tooltip/toolbar/editor strings (EN).
src/localization/src/translations/cn.ts Adds new Draw on Map tooltip/toolbar/editor strings (CN).
src/localization/src/translations/ca.ts Adds new Draw on Map tooltip/toolbar/editor strings (CA).
src/layers/src/editor-layer/modify-mode-extended.ts Skips modify when intermediate handle is hit on a line to allow translating the whole line.
src/layers/src/editor-layer/feature-styles.ts Adds filter detection + dash-array helper; adjusts point coloring behavior.
src/layers/src/editor-layer/editor-layer.ts Adds point/line drawing modes, updated fill/highlight behavior, and new dash-array logic.
src/layers/src/editor-layer/editor-layer-utils.ts Expands drawing-active detection; improves click selection logic and tooltip copy for new behaviors.
src/constants/src/default-settings.ts Adds new editor modes and EDITOR_DRAW_MODES helper list.
src/components/src/map/map-draw-panel.tsx Adds UI controls for point/line, copy-all, and convert-to-layer actions.
src/components/src/map/map-control.tsx Plumbs through the new convert-to-layer callback.
src/components/src/map/map-control-toolbar.tsx Tweaks toolbar icon container layout to better handle new icons.
src/components/src/map-container.tsx Wires convert-to-layer action and renders filter badges overlay when editor is visible.
src/components/src/editor/filter-feature-badges.tsx Adds on-map clickable badges for polygon filters.
src/components/src/editor/feature-action-panel.tsx Hides “Filter layers” panel for non-filterable geometries instead of showing disabled UI.
src/components/src/editor/editor.tsx Refines Escape key handling to avoid interfering with typing targets and improve mode reset behavior.
src/components/src/common/toolbar-item.tsx Adds disabled + tooltip support to toolbar items.
src/components/src/common/icons/line-string.tsx Adds new line icon.
src/components/src/common/icons/index.tsx Exports new icons.
src/components/src/common/icons/draw-point.tsx Adds new point icon.
src/actions/src/vis-state-actions.ts Adds convertEditorFeaturesToLayer action creator + updates editor mode docs.
src/actions/src/action-types.ts Adds CONVERT_EDITOR_FEATURES_TO_LAYER action type.
docs/user-guides/README.md Links to Draw on Map guide.
docs/user-guides/j-get-started.md Updates getting-started filters section to reference spatial filtering via Draw on Map.
docs/user-guides/e-filters.md Clarifies column vs spatial filtering and links to Draw on Map.
docs/user-guides/draw-on-map.md Adds new Draw on Map user guide.
docs/api-reference/actions/actions.md Updates setEditorMode documentation snippet and parameter description.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/components/src/editor/editor.tsx Outdated
Comment thread src/components/src/common/toolbar-item.tsx
Comment thread src/components/src/editor/filter-feature-badges.tsx Outdated
Ihor Dykhta added 2 commits August 15, 2026 21:08
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
@igorDykhta
igorDykhta requested a review from lixun910 August 15, 2026 19:43
Ihor Dykhta added 5 commits August 15, 2026 22:56
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
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