{"maintainers":[{"name":"anonymous","email":"ghybs1@gmail.com"}],"keywords":["leaflet","leaflet.markercluster","plugins","maps","subgroup"],"dist-tags":{"latest":"1.0.2"},"author":{"name":"Boris Seang"},"description":"Creates a Leaflet Feature Group that adds its child layers into a parent group when added to a map","readme":"<!-- ##########################################################################\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########################################################################### -->\n\n# Leaflet.FeatureGroup.SubGroup\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\nSize: 2 kB minified, < 1 kB gzipped.\n\n\n\n## Requirements\n*Requires Leaflet 1.0.0*\n\n*For Leaflet 0.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\n\n## Demos\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\n\n## Usage instructions\n\n### Quick Guide\n**HTML:**\n```html\n<!-- after Leaflet script -->\n<script src=\"leaflet.featuregroup.subgroup.js\"></script>\n```\n\n**JavaScript:**\n```javascript\nvar map = L.map(\"map\"),\n    parentGroup = L.markerClusterGroup(options), // Could be any other Layer Group type.\n\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\n### Installing the sub-plugin\n\n#### Local copy\n1. Download the \"<a href=\"https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup/releases/download/v1.0.2/leaflet.featuregroup.subgroup.js\">`leaflet.featuregroup.subgroup.js`</a>\" 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 > HTML](#quick-guide)) to your page after Leaflet script.\n\n#### CDN\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<!-- After Leaflet script -->\n<script src=\"https://unpkg.com/leaflet.featuregroup.subgroup@1.0.2/dist/leaflet.featuregroup.subgroup.js\"></script>\n```\n\n\n### Creation\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\n\n## API Reference\n\n### Creation\n| Factory | Description |\n| :------ | :---------- |\n| **L.featureGroup.subGroup**( `<ILayer>` parentGroup?, `<ILayer[]>` layersArray? ) | Creates a sub-group with events, optionally given a parent group and an initial array of child layers. |\n\n\n### Methods\n| Method  | Returns  | Description |\n| :------ | :------- | :---------- |\n| **setParentGroup**( `<ILayer>` parentGroup ) | `this` | Changes the parent group into which child markers are added to / removed from. |\n| **setParentGroupSafe**( `<ILayer>` 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**() | `<ILayer>` | 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\n## Limitations\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\n\n## License\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","repository":{"type":"git","url":"git+https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup.git"},"users":{"ahashem":true},"bugs":{"url":"https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup/issues"},"license":"BSD-2-Clause","versions":{"0.1.2":{"name":"leaflet.featuregroup.subgroup","version":"0.1.2","description":"Creates a Leaflet Feature Group that adds its child layers into a parent group when added to a map","main":"leaflet.featuregroup.subgroup.js","files":["leaflet.featuregroup.subgroup-src.js","leaflet.featuregroup.subgroup.js"],"directories":{"example":"examples"},"scripts":{},"repository":{"type":"git","url":"git+https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup.git"},"keywords":["leaflet","leaflet.markercluster","plugins","maps","subgroup"],"author":{"name":"Boris Seang"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup/issues"},"homepage":"https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup#readme","devDependencies":{"git-rev":"^0.2.1","magic-string":"^0.11.4","uglify-js":"^2.6.2"},"gitHead":"2ec699f11e1b6a8fa2596a1bb2b7a144d162c6d6","_id":"leaflet.featuregroup.subgroup@0.1.2","_shasum":"dcff50a6c8a1d6e3177af3df2dab8650b3d9ad54","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.12.0","_npmUser":{"name":"anonymous","email":"ghybs1@gmail.com"},"dist":{"shasum":"dcff50a6c8a1d6e3177af3df2dab8650b3d9ad54","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/leaflet.featuregroup.subgroup/-/leaflet.featuregroup.subgroup-0.1.2.tgz","integrity":"sha512-89bHt3PAcbqpwDF799h2PFk/QNOWozlluELKYeEl5IkU7XBe0SEdy3NNy49x3pG0X3jgOultzEuI2Qik70moKg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRHjFgIc8ztWYSNGPekxUsrAiJAbMSP8oW7/IMWMfmTwIhAKiMMh6PXh5Z154sNezSB6uJQfbHIZb2tN/lsxDowZxk"}]},"maintainers":[{"name":"anonymous","email":"ghybs1@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/leaflet.featuregroup.subgroup-0.1.2.tgz_1474572436560_0.3830069284886122"}},"1.0.1":{"name":"leaflet.featuregroup.subgroup","_name":"Leaflet.FeatureGroup.SubGroup","version":"1.0.1","_year":"2015-2016","description":"Creates a Leaflet Feature Group that adds its child layers into a parent group when added to a map","main":"dist/leaflet.featuregroup.subgroup.js","files":["dist/"],"directories":{"example":"examples"},"scripts":{"build":"jake build","prepublish":"jake"},"repository":{"type":"git","url":"git+https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup.git"},"keywords":["leaflet","leaflet.markercluster","plugins","maps","subgroup"],"author":{"name":"Boris Seang"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup/issues"},"homepage":"https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup#readme","devDependencies":{"git-rev":"^0.2.1","magic-string":"^0.11.4","uglify-js":"^2.6.2"},"gitHead":"acb1fa6e18f30492a27b1ab5a16d42bd2b30ef3e","_id":"leaflet.featuregroup.subgroup@1.0.1","_shasum":"e77283d799a7ab29ab295a37b5bc4f2b6c4d6e12","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.12.0","_npmUser":{"name":"anonymous","email":"ghybs1@gmail.com"},"dist":{"shasum":"e77283d799a7ab29ab295a37b5bc4f2b6c4d6e12","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/leaflet.featuregroup.subgroup/-/leaflet.featuregroup.subgroup-1.0.1.tgz","integrity":"sha512-BUwdZZPdrQB0RTVlhZzsgMZtibObiuVDqwJihAWGt2jzOuNV9I4/HRcxPBYZ+aZC2TM4ErfulR3900K97R5mQQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClDQS/gQlrFAUUNRTGLGgmbsqAg9bb+h2s+TKj5NXZ6gIgEyAXBKq1WCtwV8xpkjfr9J/Md+0I7SZ3mDSHoMK5RgI="}]},"maintainers":[{"name":"anonymous","email":"ghybs1@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/leaflet.featuregroup.subgroup-1.0.1.tgz_1474574758308_0.012371106073260307"}},"1.0.2":{"name":"leaflet.featuregroup.subgroup","_name":"Leaflet.FeatureGroup.SubGroup","version":"1.0.2","_year":"2015-2017","description":"Creates a Leaflet Feature Group that adds its child layers into a parent group when added to a map","main":"dist/leaflet.featuregroup.subgroup","files":["dist/*.js"],"directories":{"example":"examples"},"scripts":{"build":"jake build","version":"npm run build && jake buildDocs && git add README.md","postversion":"npm run build","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup.git"},"keywords":["leaflet","leaflet.markercluster","plugins","maps","subgroup"],"author":{"name":"Boris Seang"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup/issues"},"homepage":"https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup#readme","devDependencies":{"git-rev":"^0.2.1","magic-string":"^0.11.4","uglify-js":"^2.6.2"},"gitHead":"00bb0d4fd37da3cc32dbb1362b9196cfbab2b80a","_id":"leaflet.featuregroup.subgroup@1.0.2","_shasum":"ffbc96ea6db41893b6d5fb60ba09f13876c45d28","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.12.0","_npmUser":{"name":"anonymous","email":"ghybsy@gmail.com"},"dist":{"shasum":"ffbc96ea6db41893b6d5fb60ba09f13876c45d28","tarball":"http://repository.ncinga.com/nexus/content/groups/npm-all/leaflet.featuregroup.subgroup/-/leaflet.featuregroup.subgroup-1.0.2.tgz","integrity":"sha512-9nCVg8nUe686+BtPbUT7ALOe/IA+8Mum+rkA8pfPpCkH0WvKevRrH+JMcMTjAoNQKVI0uxrWrLV5w298SS3ESA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGiX7b69Om1R8TSFOGAH8bSG/0uVs5lFY1N6dt4QC5swIgBmL/Laut6eIq1PCKGKUKhnNwRryYdjDo8cRIGaam1KI="}]},"maintainers":[{"name":"anonymous","email":"ghybs1@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/leaflet.featuregroup.subgroup-1.0.2.tgz_1490558706576_0.23302386235445738"}}},"name":"leaflet.featuregroup.subgroup","time":{"modified":"2022-06-19T11:16:32.059Z","created":"2016-09-22T19:27:17.426Z","0.1.2":"2016-09-22T19:27:17.426Z","1.0.1":"2016-09-22T20:05:59.187Z","1.0.2":"2017-03-26T20:05:08.452Z"},"readmeFilename":"README.md","homepage":"https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup#readme"}