Skip to content

Releases: bemky/mapbox-gl-draw-freehand-mode

2.1.0

11 Jun 18:31
Compare
Choose a tag to compare

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
    });
}

2.0.0

18 Aug 18:27
Compare
Choose a tag to compare

Update how to implement module, check ReadMe. Fixed issue with mapbox-gl-draw update. Moved development to webpack.