Skip to content

willfarrell/Leaflet.Clipper

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
svg
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

Allows Union, Difference, Xor, and Intersection operations on two polygons.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published