Conversation
Orbit, Grid, Facade and Pencil templates could only be drawn with a mouse: the drag-to-draw handlers listened to mousedown/mousemove/mouseup, while on touch devices the gesture was swallowed by the map pan, leaving the templates unusable on tablets and phones. This adds touchstart/touchmove/touchend handlers that mirror the existing mouse flow. A single finger draws the template — preventDefault() on touchstart suppresses the map's own pan for that gesture only — while two or more fingers are left to the native pinch-zoom / pan. The mouse path is left untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
MyrkoF
added a commit
to MyrkoF/droneroute
that referenced
this pull request
Jul 30, 2026
Le merge git de feat/touch-template-drawing (basée sur main SANS orbit-z) dans dataterra-build etait textuellement propre mais semantiquement incomplet : onTouchEnd ne connaissait pas le template orbitz -> dessin Orbit+Z muet au tactile. Bloc orbitz copie de onMouseUp (identique au port dataterra 8ed4699). Ce commit n'existe QUE dans dataterra-build ; il disparaitra quand la PR fcsonline#64 sera rebasee sur un main contenant orbit-z (PR fcsonline#63).
Author
|
Closing: we'll keep maintaining these changes in our fork (MyrkoF/droneroute, branch |
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.
Problem
The mission templates (Orbit, Grid, Facade, Pencil) are drawn with a select-and-drag gesture on the map. The drag handlers in
TemplateDrawHandlerandPencilDrawHandleronly listen tomousedown/mousemove/mouseup, so on a tablet or phone the drawing gesture never fires — the touch is swallowed by the map's pan handler. In practice the templates are unusable on touch devices, which is exactly the field use case (planning a mission on a tablet on site).Fix
Add
touchstart/touchmove/touchendhandlers that mirror the existing mouse flow, alongside the mouse handlers (which are left byte-for-byte unchanged):preventDefault()on thetouchstartevent suppresses the map's ownDragPanHandler/ two-finger zoom for that gesture only (per MapLibre/MapboxMapTouchEvent.preventDefault()semantics), so the pan no longer eats the draw.e.points.length > 1) are left untouched, so native pinch-zoom / pan keeps working.mouseup. Ontouchend,lngLatis derived from the lifted finger (changedTouches), which is the correct commit position.No change to the desktop / mouse path, and no new dependencies. Pencil (freehand) benefits from the same mechanism.
Testing
npm run lint,npm run buildandnpm run test -w packages/backendall pass.🤖 Generated with Claude Code