mapbox / mapbox-gl-draw

Draw tools for mapbox-gl-js

Home Page:https://www.mapbox.com/mapbox-gl-js/example/mapbox-gl-draw/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

activate point feature when set point to draw tool by draw.add and draw.changeMode

zipporaSay opened this issue · comments

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....