mazemap / leaflet.layergroup.collision Goto Github PK
View Code? Open in Web Editor NEWLeaflet plugin for uncluttering L.Markers using basic collision detection.
License: MIT License
Leaflet plugin for uncluttering L.Markers using basic collision detection.
License: MIT License
On touch devices the collision detection doesn't work while zooming until you lift up your fingers.
Therefore it would be nice to switch to onZoom as a trigger instead of using onZoomEnd.
Quick question, will this plugin work with ui-leaflet, and leaflet 0.7.7? Thank you.
I got this on my console when opening the demo page
Uncaught ReferenceError: L is not defined
<anonymous> https://mazemap.github.io/Leaflet.LayerGroup.Collision/demo/demo.html:49
It would be desirable to make L.Tooltip
s from Leaflet 1.0.x and LayerGroup.Collision compatible - read collision boxes from labels, not assuming they are marker icons.
It seems that the GeoJSON version of this addon can't find the extended properties on itself. Simply calling L.geoJSON.collision(...)
throws
Uncaught (in promise) TypeError: Cannot read property 'push' of undefined
at NewClass.addLayer (collision.js:26)
at NewClass.addData (GeoJSON.js:127)
at NewClass.addData (GeoJSON.js:104)
at NewClass.initialize (GeoJSON.js:89)
at NewClass.initialize (collision.js:9)
at new NewClass (Class.js:22)
at Function.L.geoJson.collision (collision.js:240)
at main.js:27
I noticed there's only ever been one issue regarding GeoJSON on this repository, the one that added conditional calling of the parent constructor if the parent class was GeoJSON. But it doesn't seem to make any difference either way whether that patch is used or not.
Chrome complains about loading insecure elements. Seems there are "http" urls hard coded in the page.
Can easily work around, but with Googles push to the encrypted internet might be worth fixing.
Is it possible to use this with the 'ngx-leaflet' package for Angular?
If so, please let me know! :)
Have a great day!
Hi;
I just installed Rbush latest version ( 2.0.1 ) as a dependency, and it's not working out of the box. Adding support for 2.x or bundling with the old version would be great.
Best,
Chris
The removeLayer()
function tries to remove the cached relative box from the rbush, but the _maybeAddLayerToBush()
function inserts the calculated position (latLngToLayerPoint()-offset).
The items stored in the rbush differ from the cached ones and will never get removed.
Tested with Leaflet 1.0.3.
Hello,
Can you please add a new release for your last commits please ?
I would like to deploy your work on http://www.webjars.org/npm so that your library can be used as a maven dependency, but webjars only scans for releases on github.
Thank you for your great work !
I installed the latest version via npm and required via Browserify:
require('leaflet.layergroup.collision')
I got the following error:
Uncaught ReferenceError: rbush is not defined
I could workaround by changing the require part to the following:
global.rbush = require('rbush')
require('leaflet.layergroup.collision')
How do we safely remove the plugin in the map after we use it?
I tried removing it through: map.removeLayer(collisionLayer);, the labels are remove, but the rendering is messedup such that it affects other markers previously loaded on the map.
When I tried zooming, i encounter the following error after removing collisionLayer
Leaflet.LayerGroup.Collision.js:164 Uncaught TypeError: Cannot read property 'getZoom' of null
at e._onZoomEnd (Leaflet.LayerGroup.Collision.js:164)
at e.fire (Events.js:186)
at e._moveEnd (Map.js:1184)
at e.<anonymous> (Map.js:1628)
Would be great to have smooth transitions (fade in / fade out).
Maybe adding a CSS class to colliding/hidden elements or using a callback on collision could be alternative solutions to this instead of removing the entire element from DOM.
Cheers.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.