Draw bezier curves in mapbox-gl-js

776 views Asked by At

I am looking for a way to draw bezier curves in my mapbox gl js app. Just like this very interesting example : https://demos.mapbox.com/bezier-drawing-tool/

Unfortunately i don't find any documentation about this demo and its exactly what i am searching for.

In this demo, when you select the pen tool you can start a bezier curve by dragging the mouse. In edit mode, Bezier handles shows up and allow the user to modify the bezier spline.

The mapbox gl draw https://github.com/mapbox/mapbox-gl-draw/blob/main/docs/API.md is a very promising API but there is currently no support for bezier curve. i also looked in the available custom modes but found nothing.

As a fallback, i think i could develop a custom mode with mapbox gl draw to support bezier curves by subdividing the line in multiple segment. But before going that way i would like to know if there is already an existing support for drawing bezier curves ?

Thank you

0

There are 0 answers