{"id":16704166,"url":"https://github.com/aazuspan/leaflet-feature-legend","last_synced_at":"2025-10-08T20:29:15.827Z","repository":{"id":129061779,"uuid":"278182986","full_name":"aazuspan/leaflet-feature-legend","owner":"aazuspan","description":"A Leaflet plugin for creating feature legends","archived":false,"fork":false,"pushed_at":"2020-07-19T23:24:58.000Z","size":1092,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-23T23:14:24.348Z","etag":null,"topics":["leaflet","leaflet-plugins","map","mapping"],"latest_commit_sha":null,"homepage":"","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/aazuspan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-07-08T20:00:50.000Z","updated_at":"2023-09-20T09:26:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"3341808e-26c1-431c-bb31-78fb6e06671d","html_url":"https://github.com/aazuspan/leaflet-feature-legend","commit_stats":{"total_commits":63,"total_committers":1,"mean_commits":63.0,"dds":0.0,"last_synced_commit":"5c747e125cb455a906158b0335397db7e21e1130"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aazuspan/leaflet-feature-legend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aazuspan%2Fleaflet-feature-legend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aazuspan%2Fleaflet-feature-legend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aazuspan%2Fleaflet-feature-legend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aazuspan%2Fleaflet-feature-legend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aazuspan","download_url":"https://codeload.github.com/aazuspan/leaflet-feature-legend/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aazuspan%2Fleaflet-feature-legend/sbom","scorecard":{"id":159730,"data":{"date":"2025-08-11","repo":{"name":"github.com/aazuspan/leaflet-feature-legend","commit":"5c747e125cb455a906158b0335397db7e21e1130"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"Code-Review","score":0,"reason":"Found 0/23 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":"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":"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":"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":"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: MIT 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":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"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":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 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-16T13:00:06.718Z","repository_id":129061779,"created_at":"2025-08-16T13:00:06.719Z","updated_at":"2025-08-16T13:00:06.719Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000653,"owners_count":26082817,"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-10-08T02:00:06.501Z","response_time":56,"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":["leaflet","leaflet-plugins","map","mapping"],"created_at":"2024-10-12T19:11:32.849Z","updated_at":"2025-10-08T20:29:15.809Z","avatar_url":"https://github.com/aazuspan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# leaflet-feature-legend\nCreate legends to describe the features in your Leaflet maps.\n\n## Demo\n\u003ca href=\"https://aazuspan.github.io/leaflet-feature-legend/demo/index.html\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/aazuspan/leaflet-feature-legend/master/demo/example.jpg\" title=\"Interactive demo\" /\u003e\u003c/a\u003e\n\n## Requirements\n- Tested with Leaflet v1.6.0\n\n## Example usage\n1.  Include the script and stylesheet in your `index.html`\n```\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/aazuspan/leaflet-feature-legend/src/feature-legend.js\"\u003e\u003c/script\u003e\n\u003clink href=\"https://cdn.jsdelivr.net/gh/aazuspan/leaflet-feature-legend/src/feature-legend.css\" rel=\"stylesheet\" /\u003e\n```\n\n2. Create a Leaflet map and basemap\n```\nconst myMap = L.map('mapid').setView([51.505, -0.09], 13);\n\nL.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n    maxZoom: 19,\n    attribution: '\u0026copy; \u003ca href=\"https://www.openstreetmap.org/copyright\"\u003eOpenStreetMap\u003c/a\u003e contributors'\n}).addTo(myMap);\n```\n\n3. Create Leaflet markers\n```\nconst customIcon = L.icon({ iconUrl: 'icons/red_triangle.png', iconSize: [15, 15] });\nconst defaultMarker = L.marker([51.505, -0.09], {}).addTo(myMap);\nconst iconMarker = L.marker([51.505, -0.115], { icon: customIcon }).addTo(myMap);\nconst circleMarker = L.circleMarker([51.515, -0.08], { color: 'red' }).addTo(myMap);\n```\n\n4. Create the `items` object that will be included in the legend\n```\nconst items = {\n    \"Default marker\": defaultMarker,\n    \"Icon marker\": iconMarker,\n    \"Circle marker\": circleMarker,\n};\n```\n\n5. Create the legend, passing in `items` and `options`\n```\nconst legend = L.control.featureLegend(items, {\n    position: \"bottomleft\",\n    title: \"Shapes\",\n    symbolContainerSize: 24,\n    symbolScaling: \"clamped\",\n    maxSymbolSize: 24,\n    minSymbolSize: 2,\n    collapsed: true,\n    drawShadows: true,\n}).addTo(myMap);\n```\n\n## L.Control.FeatureLegend\n\n### Creation\n| Factory | Description |\n| :--- | :--- |\n| L.control.featureLegend(`items`, `options?`) | Creates a legend of the given items with any selected options. |\n\n### Items\n- `items` is an `object` representing the layers that will be included in the legend. \n- Each property in `items` represents a feature, and should include the feature's label and a layer from which the feature's symbol will be generated.\n  - Supported layer types are `L.Marker`, `L.CircleMarker`, or `L.Circle`. \n  - Layers that use an `L.Icon` MUST have a defined `iconSize`. An error will be thrown for icons without an `iconSize`. \n- Layers do not need to be added to the map to be included in the legend, so you can create dummy layers to represent a layer type.\n  - For example, if your markers are built using an unsupported layer type like `L.GeoJSON`, you can create an `L.Marker` with the same icon to include in the legend.\n\n### Options\n\n| Option | Type | Default | Description |\n| :--- | :--- | :--- | :--- |\n| position | String | 'topleft' | Position of the legend. Possible values are 'topleft', 'topright', 'bottomleft', or 'bottomright'. |\n| title | String | 'Legend' | Title of the legend that will be displayed. To remove the title, set to `null` or empty string. |\n| symbolContainerSize | Number | 24 | Size, in pixels, of the square container element for each symbol. |\n| symbolScaling | String | 'clamped' | Determines how symbols are rescaled to fit in the legend. Possible values are 'proportional', 'maximum', 'clamped', or 'none'. See [Symbol Scaling](#symbol-scaling) for an explanation of each option. |\n| maxSymbolSize | Number | 24 | Upper limit of symbol size, in pixels. See [Symbol Scaling](#symbol-scaling) for an explanation of how these options affect symbol size. Setting `maxSymbolSize` greater than `symbolContainerSize` is not recommended, as it may cause overlapping and other issues. |\n| minSymbolSize | Number | 2 | Lower limit of symbol size, in pixels. See [Symbol Scaling](#symbol-scaling) for an explanation of how these options affect symbol size. |\n| collapsed | Boolean | false | If `true`, the legend will be collapsed into an icon and expanded on mouse hover. |\n| drawShadows | Boolean | false | If `true`, layers using an `L.Icon` with a defined `shadowUrl` (such as the default `L.Icon`) will include the shadow in the legend symbol. |\n\n#### Symbol Scaling\nDifferent symbol scaling options are supported, and are defined using the `symbolScaling` option. The chosen symbol scaling option also affects how `maxSymbolSize` and `minSymbolSize` are implemented. These symbol scaling options apply to image icons and markers. All scaling options maintain the aspect ratio of markers and icons. \u003cbr /\u003e\n\n| Value | Description |\n| :--- | :--- |\n| proportional | All symbols are linearly scaled between `minSymbolSize` and `maxSymbolSize`. Relative scale between symbols is preserved. If you have symbols that are too large for the legend, but maintaining relative sizes is important to distinguishing symbols, this may be the best option. |\n| maximum | All symbols are scaled exactly to the `maxSymbolSize`. All symbols will appear the same size. If you have symbols that are hard to distinguish and the relative size does not matter, this may be the best option. |\n| clamped | Symbols larger than `maxSymbolSize` are scaled down to `maxSymbolSize`. Symbols smaller than `minSymbolSize` are scaled up to `minSymbolSize`. This is the simplest option to make sure symbols fit within the symbol container. However, relative scale between symbols can be misleading if some are clamped and others are not. |\n| none | No scaling is applied, and symbols are left in their native size. This may cause overlapping or other issues, but gives the user full control of scaling. |\n\n### Methods\n| Method | Returns | Description |\n| :--- | :--- | :--- |\n| expand() | `null` | Expand the legend container if collapsed |\n| collapse() | `null` | Collapse the legend container if expanded |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faazuspan%2Fleaflet-feature-legend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faazuspan%2Fleaflet-feature-legend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faazuspan%2Fleaflet-feature-legend/lists"}