Skip to content

Deflates lines and polygons to a marker when their screen size becomes too small in lower zoom levels.

License

Notifications You must be signed in to change notification settings

Proteus-tech/Leaflet.Deflate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leaflet.Deflate

Extends Leaflet.Map to automatically substitute polygons and lines with markers when their screen size falls below a defined threshold.

https://cloud.githubusercontent.com/assets/159510/7164588/090c06fe-e399-11e4-956d-0283ef7e69cf.gif

Usage

Initialize along with the minSize. minSize defines the minimum width and height in pixels for a Path to be displayed in its actual shape.

var map = L.map.deflate('map', {minSize: 20})

All options and methods from Leaflet.Map are inherited.

Developing

You'll need to install the dev dependencies to test and write the distribution file.

npm install

To run tests:

gulp test

To write a minified JS into dist:

gulp dist

Author

Oliver Roick

License

Apache 2.0

About

Deflates lines and polygons to a marker when their screen size becomes too small in lower zoom levels.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 71.5%
  • HTML 28.5%