Skip to content

2.1.0

Latest
Compare
Choose a tag to compare
@bemky bemky released this 11 Jun 18:31
· 5 commits to master since this release

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