{"id":25930504,"url":"https://github.com/doersino/leaflet-zoom2markers","last_synced_at":"2026-06-05T03:31:51.248Z","repository":{"id":249375714,"uuid":"831347587","full_name":"doersino/leaflet-zoom2markers","owner":"doersino","description":"Basic Leaflet control that zooms the map to show all markers.","archived":false,"fork":false,"pushed_at":"2025-02-14T19:25:02.000Z","size":493,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-29T14:57:11.383Z","etag":null,"topics":["leaflet-markers","leaflet-plugin","leafletjs"],"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/doersino.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-20T09:38:46.000Z","updated_at":"2025-02-14T19:25:05.000Z","dependencies_parsed_at":"2024-07-20T10:59:56.612Z","dependency_job_id":null,"html_url":"https://github.com/doersino/leaflet-zoom2markers","commit_stats":null,"previous_names":["doersino/leaflet-zoom2markers"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/doersino/leaflet-zoom2markers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doersino%2Fleaflet-zoom2markers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doersino%2Fleaflet-zoom2markers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doersino%2Fleaflet-zoom2markers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doersino%2Fleaflet-zoom2markers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doersino","download_url":"https://codeload.github.com/doersino/leaflet-zoom2markers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doersino%2Fleaflet-zoom2markers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33928630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"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-markers","leaflet-plugin","leafletjs"],"created_at":"2025-03-03T23:21:20.948Z","updated_at":"2026-06-05T03:31:51.222Z","avatar_url":"https://github.com/doersino.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Leaflet.Control.Zoom2Markers\n\nA basic [Leaflet](https://leafletjs.com) control that, when clicked, zooms the map to show all markers.\n\nIn lieu of a demo (because this plugin is so dead simple), here's a screenshot – it's the bottom-most button.\n\n![](screenshot.jpg)\n\n## Setup\n\nDownload or clone this repository, then reference the JavaScript code and stylesheet in your HTML:\n\n```html\n\u003clink rel=\"stylesheet\" href=\"Control.Zoom2Markers.css\"\u003e\n\u003cscript src=\"Control.Zoom2Markers.js\"\u003e\u003c/script\u003e\n```\n\n\n## Usage\n\nAfter initializing your map:\n\n```js\nL.control.zoom2markers({\n    position: 'topleft',\n    title: 'Zoom to Markers',\n    maxZoom: null,  // maximum zoom level, set to 17 or 18 to avoid going in too close when there's only one marker\n    forceSeparateButton: false,  // separate from +/- zoom controls?\n}).addTo(map);\n```\n\n(These are the default options, you can omit them unless you're going to assign different values.)\n\nYou can additionally specify [any options accepted by Leaflet's `fitBounds` function](https://leafletjs.com/reference.html#fitbounds-options) which will be passed straight along when that function is called on interaction with the control (the `maxZoom` option is, in fact, one such option).\n\nYou can exclude markers from consideration by setting `zoom2MarkersExclude: true` in *their* options; the zoom action will then ignore them.\n\n\n## Notes\n\nNot tested for \"interactions\" with other extensions. (This one just scoops up all layers of type `L.Marker` into a `FeatureGroup`, then `fitBounds` the map to that group's `getBounds()`.)\n\n\n## Acknowledgements\n\nThe icon is MIT Licensed and © [Etn Ccis](https://github.com/etn-ccis/blui-icons?ref=svgrepo.com).\n\nThe code is based on [Bruno Bergot's \"leaflet.fullscreen\" extension](https://github.com/brunob/leaflet.fullscreen).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoersino%2Fleaflet-zoom2markers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoersino%2Fleaflet-zoom2markers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoersino%2Fleaflet-zoom2markers/lists"}