Allows Union, Difference, Xor, and Intersection operations on two polygons.
JavaScript HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist Add npm deploy updates Jul 22, 2017
examples update docs and exmaple Jul 23, 2017
src init commit Jul 22, 2017
svg init commit Jul 22, 2017
.editorconfig Add npm deploy updates Jul 22, 2017
.eslintrc Add npm deploy updates Jul 22, 2017
.gitignore init commit Jul 22, 2017
LICENSE Initial commit Jul 21, 2017
README.md update docs and exmaple Jul 23, 2017
icons.sketch init commit Jul 22, 2017
index.html update docs and exmaple Jul 23, 2017
package.json Add npm deploy updates Jul 22, 2017

README.md

Leaflet.Clipper

Allows Union, Difference, Xor, and Intersection operations on two polygons. This is a Leaflet wrapper around JSClipper.

Install

You'll need:

  • leaflet: >=1.1.0
  • clipper-lib: ^6.2.1
  • leaflet-clipper: ^1.1.0 That's this library.

Need to run with an older version? Let me know, there was a breaking change regarding Mixin.Events. Easy to modify.

Demo

Usage

var map = ...
var layer = ...


var drawState = new L.Clipper.OR( map, {
    featureGroup: layer,
    selectedPathOptions: {
        color: '#FF3399'
    }
} );
drawState.enable();
drawState.disable();

TODO

  • Add back in tooltip support
  • Leaflet.draw integration
  • Leaflet.Editable integration
  • Extend functionality to circles

Credits