https://github.com/geovation/labelgun
🏷️ reducing label clutter across mapping libraries
https://github.com/geovation/labelgun
Last synced: about 1 year ago
JSON representation
🏷️ reducing label clutter across mapping libraries
- Host: GitHub
- URL: https://github.com/geovation/labelgun
- Owner: Geovation
- Archived: true
- Created: 2016-10-23T21:39:32.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-07-28T09:31:23.000Z (almost 5 years ago)
- Last Synced: 2025-04-10T03:55:10.551Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://geovation.github.io/labelgun/
- Size: 15.1 MB
- Stars: 115
- Watchers: 12
- Forks: 10
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

## What is Labelgun?
Labelgun is a mapping library agnostic labelling engine. It allows you to avoid cluttering in mapping popups and labels, providing precedence to labels of your choice.
The library makes three assumptions:
* Each label has a bounding rectangle (Min X, Min Y, Max X, Max Y)
* Each label has a weight
* You can provide a function that will hide and show a label (e.g. changing a CSS class or calling a mapping library method)
## Using Labelgun
### Use
You can use labelgun in your project via npm such as:
`npm install labelgun --save`
Or if you're using `yarn`:
`yarn add labelgun`
You can also use a auto-generated **CDN** thanks to unpkg :
`https://unpkg.com/labelgun@6.0.0/lib/labelgun.js`
### Docs and Demos
Check out the [docs and demos live here](http://geovation.github.io/labelgun/)
A nice interactive way to play with the demos locally is to use a hot reloading web server such as live-server:
`npm install -g live-server`
`live-server`
## Developing
For instructions please see the [DEVELOPING](https://github.com/geovation/labelgun/blob/master/DEVELOPING.md) document.
## Users
- [Vroom](http://vroom-project.org/) - Vehicle routing optimisation software
- [OL Mapbox Style](https://github.com/boundlessgeo/ol-mapbox-style) - Use Mapbox Style objects with OpenLayers
- [qgis2web](https://github.com/tomchadwin/qgis2web) - A QGIS plugin to export a map to an OpenLayers/Leaflet webmap
Using Labelgun? Open a pull request and let us know!
## Acknowledgements
Labelgun as an open source project was made possible thanks to [Podaris](http://www.podaris.com).
## License
MIT