{"id":16875518,"url":"https://github.com/ghybs/leaflet.featuregroup.subgroup","last_synced_at":"2025-08-19T03:09:34.283Z","repository":{"id":39953729,"uuid":"45894415","full_name":"ghybs/Leaflet.FeatureGroup.SubGroup","owner":"ghybs","description":"Creates a Feature Group that adds its child layers into a parent group when added to a map (e.g. through L.Control.Layers)","archived":false,"fork":false,"pushed_at":"2019-08-12T17:31:43.000Z","size":104,"stargazers_count":115,"open_issues_count":0,"forks_count":21,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-02T19:03:01.790Z","etag":null,"topics":["javascript","leaflet","leaflet-plugins","markercluster","subgroups"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghybs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-10T07:12:22.000Z","updated_at":"2025-04-12T00:58:00.000Z","dependencies_parsed_at":"2022-09-05T16:51:45.875Z","dependency_job_id":null,"html_url":"https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/ghybs/Leaflet.FeatureGroup.SubGroup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghybs%2FLeaflet.FeatureGroup.SubGroup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghybs%2FLeaflet.FeatureGroup.SubGroup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghybs%2FLeaflet.FeatureGroup.SubGroup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghybs%2FLeaflet.FeatureGroup.SubGroup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghybs","download_url":"https://codeload.github.com/ghybs/Leaflet.FeatureGroup.SubGroup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghybs%2FLeaflet.FeatureGroup.SubGroup/sbom","scorecard":{"id":425960,"data":{"date":"2025-08-11","repo":{"name":"github.com/ghybs/Leaflet.FeatureGroup.SubGroup","commit":"c7ec78b0cf13be39b00d46beb50c954b8b4c78bb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 2-Clause \"Simplified\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.0.2 not signed: https://api.github.com/repos/ghybs/Leaflet.FeatureGroup.SubGroup/releases/5872620","Warn: release artifact v1.0.1 not signed: https://api.github.com/repos/ghybs/Leaflet.FeatureGroup.SubGroup/releases/4207501","Warn: release artifact v0.1.2 not signed: https://api.github.com/repos/ghybs/Leaflet.FeatureGroup.SubGroup/releases/4207111","Warn: release artifact v1.0.0 not signed: https://api.github.com/repos/ghybs/Leaflet.FeatureGroup.SubGroup/releases/3076911","Warn: release artifact v0.1.1 not signed: https://api.github.com/repos/ghybs/Leaflet.FeatureGroup.SubGroup/releases/3076900","Warn: release artifact v1.0.2 does not have provenance: https://api.github.com/repos/ghybs/Leaflet.FeatureGroup.SubGroup/releases/5872620","Warn: release artifact v1.0.1 does not have provenance: https://api.github.com/repos/ghybs/Leaflet.FeatureGroup.SubGroup/releases/4207501","Warn: release artifact v0.1.2 does not have provenance: https://api.github.com/repos/ghybs/Leaflet.FeatureGroup.SubGroup/releases/4207111","Warn: release artifact v1.0.0 does not have provenance: https://api.github.com/repos/ghybs/Leaflet.FeatureGroup.SubGroup/releases/3076911","Warn: release artifact v0.1.1 does not have provenance: https://api.github.com/repos/ghybs/Leaflet.FeatureGroup.SubGroup/releases/3076900"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T02:15:53.912Z","repository_id":39953729,"created_at":"2025-08-19T02:15:53.913Z","updated_at":"2025-08-19T02:15:53.913Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271093041,"owners_count":24697917,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["javascript","leaflet","leaflet-plugins","markercluster","subgroups"],"created_at":"2024-10-13T15:36:17.148Z","updated_at":"2025-08-19T03:09:34.254Z","avatar_url":"https://github.com/ghybs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- ##########################################################################\nNOTE TO CONTRIBUTOR:\nthis README is automatically generated from build/readme.template.md.\nShould you need to modify the README, please make your modifications on\nthe template file.\n########################################################################### --\u003e\n\n# Leaflet.FeatureGroup.SubGroup\n\nCreates a Leaflet Feature Group that adds its child layers into a parent group\nwhen added to a map (e.g. through L.Control.Layers).\n\n**Typical usage is to dynamically add/remove groups of markers from\n[Marker Cluster](https://github.com/Leaflet/Leaflet.markercluster).**\n\n[Leaflet.markercluster](https://github.com/Leaflet/Leaflet.markercluster) plugin\nprovides beautiful animated Marker Clustering functionality.\n\n[Leaflet](http://leafletjs.com/) is the leading open-source JavaScript library\nfor mobile-friendly interactive maps.\n\n[![GitHub releases](https://img.shields.io/github/release/ghybs/leaflet.featuregroup.subgroup.svg?label=GitHub)](https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup/releases)\n[![npm](https://img.shields.io/npm/v/leaflet.featuregroup.subgroup.svg)](https://www.npmjs.com/package/leaflet.featuregroup.subgroup)\n[![TypeScript definitions on DefinitelyTyped](https://definitelytyped.org/badges/standard.svg)](https://definitelytyped.org)\n[![types](https://img.shields.io/npm/types/@types/leaflet.featuregroup.subgroup)](https://www.npmjs.com/package/@types/leaflet.featuregroup.subgroup)\n\nSize: 2 kB minified, \u003c 1 kB gzipped.\n\n## Requirements\n\n_Requires Leaflet ^1.0.0_\n\n_For Leaflet ~0.7.7 use the [v0.1.2 release](https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup/releases/tag/v0.1.2) or the [leaflet-0.7 branch](https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup/tree/leaflet-0.7)_\n\n_Optional: [Leaflet.markercluster](https://github.com/Leaflet/Leaflet.markercluster) plugin_\n\n## Demos\n\n- [SubGroup with standard L.Control.Layers and MarkerCluster](https://ghybs.github.io/Leaflet.FeatureGroup.SubGroup/examples/subGroup-markercluster-controlLayers-realworld.388.html)\n- [SubGroup with standard L.Control.Layers to display Nested Groups](https://ghybs.github.io/Leaflet.FeatureGroup.SubGroup/examples/subGroup-controlLayers-nestedGroups.html)\n\n## Usage instructions\n\n### Quick Guide\n\n**HTML:**\n\n```html\n\u003c!-- after Leaflet script --\u003e\n\u003cscript src=\"leaflet.featuregroup.subgroup.js\"\u003e\u003c/script\u003e\n```\n\n**JavaScript:**\n\n```javascript\nvar map = L.map(\"map\"),\n  parentGroup = L.markerClusterGroup(options), // Could be any other Layer Group type.\n  // This is where the magic happens!\n  mySubGroup = L.featureGroup.subGroup(parentGroup, arrayOfMarkers);\n\nparentGroup.addTo(map);\nmySubGroup.addTo(map);\n```\n\nNow adding the sub-group to the map adds clustered markers!\n\nIt should virtually be compatible with any LayerGroup plugin, not only MarkerCluster.\n\n### Installing the sub-plugin\n\n#### Local copy\n\n1. Download the \"\u003ca href=\"https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup/releases/download/v1.0.2/leaflet.featuregroup.subgroup.js\"\u003e`leaflet.featuregroup.subgroup.js`\u003c/a\u003e\" file from the [`v1.0.2` release](https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup/releases/tag/v1.0.2).\n2. Place the file alongside your page.\n3. Add the `script` tag (see [Quick Guide \u003e HTML](#quick-guide)) to your page after Leaflet script.\n\n#### CDN\n\nYou can alternatively use the free [unpkg](https://unpkg.com) CDN service, but keep in mind that it \"[_is a free, best-effort service and cannot provide any uptime or support guarantees_](https://unpkg.com/#/about)\".\n\n```html\n\u003c!-- After Leaflet script --\u003e\n\u003cscript src=\"https://unpkg.com/leaflet.featuregroup.subgroup@1.0.2/dist/leaflet.featuregroup.subgroup.js\"\u003e\u003c/script\u003e\n```\n\n#### npm\n\n1. Add this package to your project:\n\n   ```bash\n   $ npm install leaflet.featuregroup.subgroup --save\n   ```\n\n2. If you are using a bundling tool, import in your JavaScript.\n   It only performs the side effect of attaching to the global `L` namespace,\n   so you do not need to store it into a local variable or import a namespace.\n   ```javascript\n   require(\"leaflet.featuregroup.subgroup\");\n   // Or with ES6:\n   import \"leaflet.featuregroup.subgroup\";\n   ```\n\n### Creation\n\nSimply use the `L.featureGroup.subGroup` factory instead of your regular `L.featureGroup` or `L.layerGroup`:\n\n```javascript\nvar mySubGroup = L.featureGroup.subGroup(parentGroup);\n\nmySubGroup.addTo(map);\n```\n\nDo not forget to add the parent group to your map.\n\n## API Reference\n\n### Creation\n\n| Factory                                                                           | Description                                                                                            |\n| :-------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------- |\n| **L.featureGroup.subGroup**( `\u003cILayer\u003e` parentGroup?, `\u003cILayer[]\u003e` layersArray? ) | Creates a sub-group with events, optionally given a parent group and an initial array of child layers. |\n\n### Methods\n\n| Method                                           | Returns    | Description                                                                                                                      |\n| :----------------------------------------------- | :--------- | :------------------------------------------------------------------------------------------------------------------------------- |\n| **setParentGroup**( `\u003cILayer\u003e` parentGroup )     | `this`     | Changes the parent group into which child markers are added to / removed from.                                                   |\n| **setParentGroupSafe**( `\u003cILayer\u003e` parentGroup ) | `this`     | Removes the current sub-group from map before changing the parent group. Re-adds the sub-group to map if it was before changing. |\n| **getParentGroup**()                             | `\u003cILayer\u003e` | Returns the current parent group.                                                                                                |\n\nSubGroup does not provide any extra option or event beyond what\n[L.LayerGroup](http://leafletjs.com/reference.html#layergroup) and\n[L.FeatureGroup](http://leafletjs.com/reference.html#featuregroup) already provide.\n\n## Limitations\n\nIf you change the parent group while the sub-group and/or its child markers are still on map, unexpected behaviour of the previous and/or new parent groups can happen.\n\nMake sure the sub-group and its child layers are removed from map before changing the parent group, or use the `setParentGroupSafe` method instead.\n\n## License\n\n[![license](https://img.shields.io/github/license/ghybs/leaflet.featuregroup.subgroup.svg)](LICENSE)\n\nLeaflet.FeatureGroup.SubGroup is distributed under the [BSD 2-clause \"Simplified\" License](http://choosealicense.com/licenses/bsd-2-clause/), like Leaflet.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghybs%2Fleaflet.featuregroup.subgroup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghybs%2Fleaflet.featuregroup.subgroup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghybs%2Fleaflet.featuregroup.subgroup/lists"}