mapbox / mapbox/mapbox-gl-draw
activate point feature when set point to draw tool by draw.add and draw.changeMode
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 612
- Avg merge
- 8d 9h
- Merged PRs (30d)
- 5
Description
**mapbox-gl-js version**:
1.11.1
**mapbox-gl-draw version**:
1.2.0
### Steps to Trigger Behavior
i have features and want to edit them:
const featureIds = this.draw.add(geoInsight);
this.draw.setFeatureProperty(featureIds[0], 'myFillColorProperty', this.geoInsight.color);
this.draw.setFeatureProperty(featureIds[0], 'draw_type', this.geoInsight.geometricType);
this.draw.changeMode((this.geoInsight.geometricType === GeometryType.POINT ? 'simple_select' : 'direct_select'), { featureId: featureIds[0] });
as you seemed in type point i use simple_select mode as in docs: https://github.com/mapbox/mapbox-gl-draw/blob/main/docs/API.md#direct_select
### Expected Behavior
i want point to be activate like put feature in draw tool by direct_select,
and emit draw.selectionchange when clickoutside selected point.
### Actual Behavior
set point by simple_select and currently draw.selectionchange not emit when clickoutside selected point....
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided draw.add and draw.changeMode sequence with a point, comparing simple_select with direct_select behavior. Inspect the simple_select and direct_select mode entry points and selectionchange handling; done means the point is activated as expected and clicking outside emits draw.selectionchange.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100