Draggable Symbols not working when setting mapview.setOnTouchListener(null)

Open
#1,140 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
mobile

Research direction

Start by reproducing the Drawing Search Area flow from the linked guide: create draggable symbols, draw a line, then call MapView.setOnTouchListener(null). Read the MapView touch-listener handling alongside the SymbolManager drag flow. Done means symbols remain draggable after the listener is cleared while existing clicks, long clicks, panning, and zooming still work.

Written by the indexing model from the issue text.

Description

Hi, in my application I create symbols on the MapView using a SymbolManager and provide an option for dragging them by calling symbol.setDraggable(true) .

However, if I draw a line on the map and after finish drawing it I call mapView.setOnTouchListener(null), symbols can no longer be dragged. (followed guide Drawing Search Area: https://docs.mapbox.com/android/maps/examples/finger-draw-query/ )

Everything else (clicking and long clicking on lines, symbols etc) seems to be working ok. Also all other gestures (pan, zoom etc). I don't understand how setting the touch listener to null disables dragging the symbols.

Dominant language
Java
Stars
242
Forks
116
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mapbox/mapbox-plugins-android

All issues in mapbox/mapbox-plugins-android

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.