{"id":13907411,"url":"https://github.com/MazeMap/Leaflet.LayerGroup.Collision","last_synced_at":"2025-07-18T05:31:40.218Z","repository":{"id":29642068,"uuid":"33183486","full_name":"MazeMap/Leaflet.LayerGroup.Collision","owner":"MazeMap","description":"Leaflet plugin for uncluttering L.Markers using basic collision detection.","archived":true,"fork":false,"pushed_at":"2024-11-21T14:57:38.000Z","size":768,"stargazers_count":100,"open_issues_count":10,"forks_count":36,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-07-02T03:48:45.592Z","etag":null,"topics":["collision-detection","javascript","leaflet","leaflet-plugins"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MazeMap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-31T12:13:30.000Z","updated_at":"2025-02-21T07:23:59.000Z","dependencies_parsed_at":"2022-09-03T18:41:04.216Z","dependency_job_id":null,"html_url":"https://github.com/MazeMap/Leaflet.LayerGroup.Collision","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/MazeMap/Leaflet.LayerGroup.Collision","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MazeMap%2FLeaflet.LayerGroup.Collision","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MazeMap%2FLeaflet.LayerGroup.Collision/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MazeMap%2FLeaflet.LayerGroup.Collision/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MazeMap%2FLeaflet.LayerGroup.Collision/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MazeMap","download_url":"https://codeload.github.com/MazeMap/Leaflet.LayerGroup.Collision/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MazeMap%2FLeaflet.LayerGroup.Collision/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265705374,"owners_count":23814436,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collision-detection","javascript","leaflet","leaflet-plugins"],"created_at":"2024-08-06T23:01:55.678Z","updated_at":"2025-07-18T05:31:39.785Z","avatar_url":"https://github.com/MazeMap.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Deprecated\n\nThis repository is no longer maintained and is deprecated. Please be aware that it may not work with the latest versions of its dependencies.\n\n---\n\nLeaflet.LayerGroup.Collision\n================================\n\nProvides basic collision detection in order to declutter large or overlapping sets of Leaflet markers.\n\nDon't like READMEs? Then see http://mazemap.github.io/Leaflet.LayerGroup.Collision/demo/demo.html\n\n\nWhat?\n--------\n\nInspired by the ClusterMarker plugin, this plugin works by hiding any markers that overlap each other - only the marker which was first added to the LayerGroup will be shown.\n\n\n\nHow?\n--------\n\nCollision detection is done by using the dimensions of the DOM elements inside the `L.Marker`'s icon; this has been tested only using `display:block` elements. `L.Layer`s which are not markers will be always shown.\n\nThis plugin uses Vladimir Agafonkin's `rbush` library for the grunt work of detecting bounding box collisions.\n\nCaveats: this plugin expects markers to not change dynamically, to not be draggable, and marker deletion is not supported (yet). Currently everything is recalculated on zoom change. Only partial data caching is done - marker bounding boxes are cached; collisions per zoom level are recalculated.\n\n\nUsage\n-------------\n\nWorks as a normal Leaflet LayerGroup, just add your markers to it.\n\nWhen instantiating, can take the 'margin' option. This defines the margin between markers, in pixels, and defaults to zero.\n\n```\nvar collisionLayer = L.layerGroup.collision({margin:5});\ncollisionLayer.addTo(map);\n\ncollisionLayer.add( L.marker( markeroptions ) );\n```\n\nThis plugin also extends `L.FeatureGroup` into `L.FeatureGroup.collision` and `L.GeoJSON` into `L.GeoJSON.collision`.\n\n\nDemo\n------\n\nThere is a live demo at http://mazemap.github.io/Leaflet.LayerGroup.Collision/demo/demo.html\n\nThe demo loads about 1000 placenames, each of them being a `L.DivIcon` with two boxes.\n\nThe demo includes data from Natural Earth, which is public domain. Please visit  http://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-populated-places/ for more information.\n\nIn order to try the demo locally, just clone the repo, run `bower install` (if using the `gh-pages` branch, use `git clone --recursive` instead to pull the `rbush` submodule), and see the file `demo/demo.html`. You can choose to load more or less data by commenting/uncommenting the lines that include the natural earth data files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMazeMap%2FLeaflet.LayerGroup.Collision","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMazeMap%2FLeaflet.LayerGroup.Collision","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMazeMap%2FLeaflet.LayerGroup.Collision/lists"}