mapbox-gl-draw icon indicating copy to clipboard operation
mapbox-gl-draw copied to clipboard

chore: export constants and lib through MapboxDraw

Open thaddmt opened this issue 3 years ago • 3 comments

Overview

  • Saw there was an issue for exposing API's to make it easier to write custom draw modes - https://github.com/mapbox/mapbox-gl-draw/issues/1056
    • Experiencing a similar issue here - https://github.com/aws-amplify/maplibre-gl-draw-circle
  • Added everything in Constants and Lib to the MapboxDraw default export
    • Considered making them separate named exports from the default but wanted to keep it in line with modes which is also added directly onto the MapboxDraw object

thaddmt avatar Mar 16 '22 20:03 thaddmt

This is blocking us from updating to the latest version of mapbox-gl-draw and would be great to get feedback from the Mapbox team if this is something that can move forward. We import these utilities specifically in our libraries in order to draw circular geofences efficiently.

TreTuna avatar Apr 25 '22 17:04 TreTuna

@mourner are you able to look at this (or point to another maintainer, assuming that this is still maintained)?

mojodna avatar Apr 25 '22 22:04 mojodna

Any update on getting this PR reviewed by the maintainers?

reesscot avatar Jun 29 '22 01:06 reesscot

Awesome, is there any reason why the "mouseEventPoint" function was not exported from the lib? I'm using it in a custom mode.

https://github.com/mapbox/mapbox-gl-draw/blob/main/src/lib/mouse_event_point.js

awulkan avatar Feb 01 '23 08:02 awulkan

Hey everyone! I'm sorry for not getting back to you sooner. This change looks good to me 👍

please sync update the @types/mapbox__mapbox-gl-draw packages (npmjs.com),otherwise to use MapboxDraw.lib will report errors.

random-play avatar Feb 01 '23 09:02 random-play