Geovation / labelgun

🏷️ reducing label clutter across mapping libraries
https://geovation.github.io/labelgun/
113 stars 10 forks source link

Show an example of draggin a marker/label #31

Open JamesLMilner opened 6 years ago

JamesLMilner commented 6 years ago

Labelgun has the ability to set a label to be 'dragged' which in turn makes it's weight infinite and always shown in the collision calculations. An example in Leaflet or OpenLayers would be super!

Here's an example of how you might do it:

   // The last argument is dragged which we set to true
    labelEngine.ingestLabel(
      boundingBox,
      id,
      parseInt(Math.random() * (5 - 1) + 1), // Weight
      label,
      "Test " + id,
      true 
    );