Releases: bemky/mapbox-gl-draw-freehand-mode
Releases · bemky/mapbox-gl-draw-freehand-mode
2.1.0
Refactored algorithm for tolerance to function better at low and high zooms.
Separated simplify
method into it's own method so it can now be overwritten.
Example removing simplification
import FreehandMode from 'mapbox-gl-draw-freehand-mode';
FreehandMode.simplify = function (polygon, zoom) {}
Example with your own tolerance calculation
import FreehandMode from 'mapbox-gl-draw-freehand';
FreehandMode.simplify = function (polygon, zoom) {
simplify(polygon, {
mutate: true,
tolerance: 1 / Math.pow(2, zoom),
highQuality: true
});
}