mapbox / mapbox/mapbox-gl-draw

Detect when feature is being dragged instead of after update

Open
#1,188 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged feature
Dominant language
JavaScript
Stars
1.1k
Forks
612
Avg merge
8d 9h
Merged PRs (30d)
5

Description

map.on("draw.create", onCreate);
map.on("draw.update", onUpdate);
map.on("draw.delete", onDelete);
map.on("draw.modechange", onModeChange);
map.on("draw.selectionchange", onSelectionChange);
// map.on("draw.dragFeature", ...);

Is there any simple way to detect if a feature is being moved?

I'm considering if creating a custom mode is necessary or If I have to do this on the mapbox side of things.

Thanks

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.

Research direction

Start by reviewing the existing draw.create, draw.update, draw.delete, draw.modechange, and draw.selectionchange event handlers, then examine how custom modes relate to feature movement. Determine whether movement can be detected as a distinct event without relying only on draw.update or requiring mapbox-gl-side changes. Done means the movement state or event is reliably distinguishable.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.