-
-
Notifications
You must be signed in to change notification settings - Fork 108
[Feature Request] Mobile long-press + drag freehand drawing mode (touch-first UX) #827
Description
Is your feature request related to a problem? Please describe.
On mobile devices, drawing polygons by tapping points is slower and less intuitive than “press and drag” freehand interactions. In map UIs where users frequently draw search areas, this creates friction and increases accidental map panning instead of drawing. We currently use Terra Draw with MapLibre and have a good desktop freehand flow, but mobile users need a touch-optimized way to start freehand drawing intentionally.
Describe your proposed idea for the solution to this problem
Add first-class support for mobile touch freehand drawing with an intentional gesture, such as:
Long-press (e.g., 250-500ms) to enter freehand capture
Drag to draw continuously
Release to complete polygon
Auto-close polygon and emit standard change/finish events
Ideally this works in TerraDrawFreehandMode via options (e.g., touchLongPressMs, touchOnly, disableMapDragWhileDrawing) so developers can enable a clean mobile UX without custom event plumbing.
Describe alternatives you've considered
Current workaround: Use PolygonMode on mobile (tap-to-add-vertex). Works, but UX is slower and less natural.
Custom app-level gesture handling: Implement long-press detection outside Terra Draw, toggle map drag/pan manually, then switch modes. Possible, but brittle and duplicates logic that likely belongs in core mode behavior.
Custom mode/adapters: Could build a custom mode on top of existing APIs, but this increases maintenance burden and is harder to keep aligned with upstream updates.
Other libraries/plugins: Some Mapbox/MapLibre ecosystems offer freehand plugins with touch drag behavior, but we prefer to stay on Terra Draw for consistency and maintainability.
Additional context
Use case: mobile map-based real estate area search, where users frequently sketch neighborhoods quickly.
Expected UX on mobile: “Touch and hold to start drawing, drag your finger, release to finish.”
If helpful, we can test/provide feedback on API design or beta behavior across iOS Safari and Android Chrome.