GithubHelp home page GithubHelp logo

jasisz / labelgun Goto Github PK

View Code? Open in Web Editor NEW

This project forked from geovation/labelgun

0.0 1.0 0.0 15.44 MB

๐Ÿท๏ธ reducing label clutter across mapping libraries

Home Page: https://geovation.github.io/labelgun/

JavaScript 100.00%

labelgun's Introduction

labelgun


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)

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/[email protected]/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

Developing

For instructions please see the DEVELOPING document.

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

labelgun's People

Contributors

davidpiesse avatar jameslmilner avatar tomchadwin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.