Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

labelgun

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

labelgun

A mapping library agnostic labelling engine


Version published
Weekly downloads
594
increased by36.55%
Maintainers
1
Weekly downloads
 
Created
Source

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. through CSS class or JavaScript function)



Labelgun example in leaflet

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@5.0.1/lib/labelgun.js

Docs and Demos

Check out the docs and demos live here

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

Develop

Building

We can install all the required dependencies using node and npm:

npm install

Labelgun is transpiled from ES6 using babel presets for Webpack 2. You can build the source using:

npm run build

or:

npm run build-prod

For the minified version. You can also watch the file with:

npm run watch

Tests

Labelgun uses Jasmine for testing. You can do an npm install and then use:

npm run test

at the command line. Tests are found in the spec folder. We can also run test coverage as so:

npm run coverage

GitHub Pages & NPM

GitHub pages documentation deployment:

npm deploy-doc

NPM updating:

npm publish

Users

  • Vroom - Vehicle routing optimisation software
  • OL Mapbox Style - Use Mapbox Style objects with OpenLayers
  • 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.

License

MIT

FAQs

Package last updated on 06 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc