question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Colliding/overlapping tooltips with {permanent: true}

See original GitHub issue
  • I’m reporting a bug, not asking for help (more a feature request than a bug)
  • I’ve looked at the documentation to make sure the behaviour is documented and expected
  • I’m sure this is a Leaflet code issue, not an issue with my own code nor with the framework I’m using (Cordova, Ionic, Angular, React…)
  • I’ve searched through the issues to make sure it’s not yet reported

How to reproduce

  • Leaflet version I’m using: 1.0.0

  • Browser (with version) I’m using: Chrome 54.0.2840.99 m

  • OS/Platform (with version) I’m using: Win7 x64

  • add a point layer with high point density

  • enable tooltips

  • use tooltip option permanent: true

What behaviour I’m expecting and which behaviour I’m seeing

  • I would hope for (not expect) an option to prevent overlapping tooltips
  • I see overlapping tooltips

Minimal example reproducing the issue

http://playground-leaflet.rhcloud.com/zohe/edit?html,output

  • this example is as simple as possible
  • this example does not rely on any third party code

A plugin existed to hide colliding features, and an issue was raised in the Leaflet.Label repo to adapt for pre-Leaflet1.0.0 labels, but I don’t believe it was implemented:

https://github.com/Leaflet/Leaflet.label/issues/128 https://github.com/MazeMap/Leaflet.LayerGroup.Collision/issues/1

Any plans to implement something for the new Leaflet1 tooltips?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
perliedmancommented, Nov 16, 2016

While I agree this would be nice, I think handling label collision is too complex to fit in Leaflet’s core.

I would suggest you look into this plugin, which sounds like it could be useful in your use case: https://github.com/yakitoritabetai/Leaflet.LabelTextCollision

2reactions
tomchadwincommented, Apr 10, 2017

@Shadowman4205 No, I’ve not implemented any solution to this myself. However, you should take a look at @JamesMilnerUK’s Labelgun:

https://github.com/Geovation/labelgun

I believe that’s a perfect solution to the issue, but I’ve not understood it well enough yet to implement it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove Leaflet tooltip label collision
This will be brute force simple solution for the case when tooltip number is not too high. It's based on the fact it's...
Read more >
CSS tooltip issue with overlapping tooltips - Stack Overflow
The problem is when you have a tooltip that is below another tooltip, i.e. its contents stay hidden when hovering over the container...
Read more >
Introduction to collision - Unity - Manual
A static collider is a GameObject that has a Collider but no Rigidbody. Static colliders are mostly used for level geometry which always...
Read more >
How To Solve Leaflet Popup Overlap - ADocLib
Colliding /overlapping tooltips with {permanent: true} #5104 I'm sure this is a Leaflet code issue not an issue with my own code nor...
Read more >
Fix Text Overlap with CSS white-space | SamanthaMing.com
Fix overlapping text by setting CSS white-space from. ... there is no overlapping. Great! But let's see what happen we set a fixed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found