{"id":13907112,"url":"https://github.com/mapbox/leaflet-image","last_synced_at":"2026-02-21T02:01:36.991Z","repository":{"id":9978393,"uuid":"12005748","full_name":"mapbox/leaflet-image","owner":"mapbox","description":"leaflet maps to images","archived":false,"fork":false,"pushed_at":"2019-01-06T15:00:22.000Z","size":774,"stargazers_count":379,"open_issues_count":51,"forks_count":142,"subscribers_count":137,"default_branch":"gh-pages","last_synced_at":"2026-02-13T10:37:09.625Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://mapbox.github.io/leaflet-image/","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/mapbox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-09T16:42:26.000Z","updated_at":"2026-01-02T08:21:52.000Z","dependencies_parsed_at":"2022-09-05T16:51:45.311Z","dependency_job_id":null,"html_url":"https://github.com/mapbox/leaflet-image","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/mapbox/leaflet-image","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Fleaflet-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Fleaflet-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Fleaflet-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Fleaflet-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mapbox","download_url":"https://codeload.github.com/mapbox/leaflet-image/tar.gz/refs/heads/gh-pages","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Fleaflet-image/sbom","scorecard":{"id":616481,"data":{"date":"2025-08-11","repo":{"name":"github.com/mapbox/leaflet-image","commit":"285edd3bf4d28135b8db011ffd129b3187b78de7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.7,"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":"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":"Code-Review","score":1,"reason":"Found 3/30 approved changesets -- score normalized to 1","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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: BSD 2-Clause \"Simplified\" License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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":"Branch-Protection","score":5,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'gh-pages'","Info: 'force pushes' disabled on branch 'gh-pages'","Warn: 'branch protection settings apply to administrators' is disabled on branch 'gh-pages'","Warn: 'stale review dismissal' is disabled on branch 'gh-pages'","Warn: required approving review count is 1 on branch 'gh-pages'","Warn: codeowners review is not required on branch 'gh-pages'","Warn: 'last push approval' is disabled on branch 'gh-pages'","Warn: no status checks found to merge onto branch 'gh-pages'","Info: PRs are required in order to make changes on branch 'gh-pages'"],"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":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/mapbox/.github/SECURITY.md:1","Info: Found linked content: github.com/mapbox/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/mapbox/.github/SECURITY.md:1","Info: Found text in security policy: github.com/mapbox/.github/SECURITY.md:1"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 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-21T04:08:53.997Z","repository_id":9978393,"created_at":"2025-08-21T04:08:53.997Z","updated_at":"2025-08-21T04:08:53.997Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29671513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T00:11:43.526Z","status":"online","status_checked_at":"2026-02-21T02:00:07.432Z","response_time":107,"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":[],"created_at":"2024-08-06T23:01:47.908Z","updated_at":"2026-02-21T02:01:36.973Z","avatar_url":"https://github.com/mapbox.png","language":"JavaScript","readme":"## leaflet-image\n\n[![CircleCI](https://circleci.com/gh/mapbox/leaflet-image/tree/gh-pages.svg?style=svg)](https://circleci.com/gh/mapbox/leaflet-image/tree/gh-pages)\n\nExport images out of Leaflet maps without a server component, by using\nCanvas and [CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing).\n\n## Requirements\n\n* Tile layer providers (OSM, MapBox, etc) must support [CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing)\n* Any markers on the map must also support CORS. The default Leaflet-CDN markers\n  don't, so they aren't supported.\n* Your browser must support [CORS](http://caniuse.com/#feat=cors) and [Canvas](http://caniuse.com/#feat=canvas),\n  so `IE \u003e= 10` with no exceptions.\n* This library **does not rasterize HTML** because **browsers cannot rasterize HTML**. Therefore,\n  L.divIcon and other HTML-based features of a map, like zoom controls or legends, are not\n  included in the output, because they are HTML.\n\n__For Leaflet \u003c 1.0.0__: You must set `L_PREFER_CANVAS = true;` so that vector\n  layers are drawn in Canvas\n  \n__For Leaflet \u003e= 1.0.0__: You must set `renderer: L.canvas()` for any layer that\n  you want included in the generated image. You can also set this by setting [`preferCanvas: true`](http://leafletjs.com/reference-1.0.0.html#map-prefercanvas) in your map's options.\n  \n## Plugins that will _not_ work with leaflet-image\n\n* Leaflet.label: will not work because it uses HTML to display labels.\n* Leaflet.markercluster: will not work because it uses HTML for clusters.\n\n### Usage\n\nbrowserify\n\n    npm install --save leaflet-image\n\nweb\n\n    curl -L https://unpkg.com/leaflet-image@latest/leaflet-image.js \u003e leaflet-image.js\n\n### Example\n\n```js\nvar map = L.mapbox.map('map', 'YOUR.MAPID').setView([38.9, -77.03], 14);\nleafletImage(map, function(err, canvas) {\n    // now you have canvas\n    // example thing to do with that canvas:\n    var img = document.createElement('img');\n    var dimensions = map.getSize();\n    img.width = dimensions.x;\n    img.height = dimensions.y;\n    img.src = canvas.toDataURL();\n    document.getElementById('images').innerHTML = '';\n    document.getElementById('images').appendChild(img);\n});\n```\n\n### Plugin CDN\n\nleaflet-image is [available through the Mapbox Plugin CDN](https://www.mapbox.com/mapbox.js/plugins/#leaflet-image) so you don't need to download \u0026 copy it. Just include the following script tag:\n\n```html\n\u003cscript src='//api.tiles.mapbox.com/mapbox.js/plugins/leaflet-image/v0.0.4/leaflet-image.js'\u003e\u003c/script\u003e\n```\n\n### API\n\n```js\nleafletImage(map, callback)\n```\n\nmap is a `L.map` or `L.mapbox.map`, callback takes `(err, canvas)`.\n\n## Attribution\n\nAny images you generate from maps that require attribution - which is most, including all from commercial sources and those that include any data from OpenStreetMap - will require the same attribution as the map did. Remember to attribute.\n\n## See Also\n\n* The [Mapbox Static Image API](https://www.mapbox.com/developers/api/static/) is simpler to use\n  and faster than this approach.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapbox%2Fleaflet-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmapbox%2Fleaflet-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapbox%2Fleaflet-image/lists"}