{"id":19076483,"url":"https://github.com/torfsen/leaflet.zoomhome","last_synced_at":"2025-06-10T22:05:53.401Z","repository":{"id":28202270,"uuid":"31704675","full_name":"torfsen/leaflet.zoomhome","owner":"torfsen","description":"A Leaflet zoom control with a home button for resetting the view.","archived":false,"fork":false,"pushed_at":"2021-03-19T19:07:52.000Z","size":112,"stargazers_count":50,"open_issues_count":12,"forks_count":33,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-31T09:52:04.844Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://torfsen.github.io/leaflet.zoomhome","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/torfsen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-05T08:55:23.000Z","updated_at":"2024-08-05T19:10:55.000Z","dependencies_parsed_at":"2022-07-27T12:47:50.629Z","dependency_job_id":null,"html_url":"https://github.com/torfsen/leaflet.zoomhome","commit_stats":null,"previous_names":["torfuspolymorphus/leaflet.zoomhome"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torfsen%2Fleaflet.zoomhome","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torfsen%2Fleaflet.zoomhome/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torfsen%2Fleaflet.zoomhome/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torfsen%2Fleaflet.zoomhome/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/torfsen","download_url":"https://codeload.github.com/torfsen/leaflet.zoomhome/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torfsen%2Fleaflet.zoomhome/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259159661,"owners_count":22814496,"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","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-11-09T01:59:29.723Z","updated_at":"2025-06-10T22:05:53.377Z","avatar_url":"https://github.com/torfsen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Leaflet.zoomhome\n\n[![Travis CI badge](https://api.travis-ci.org/torfsen/leaflet.zoomhome.svg?branch=master)](https://travis-ci.org/torfsen/leaflet.zoomhome)\n\nA [Leaflet](http://leafletjs.com/)-plugin that provides a zoom control with a\n\"Home\" button to reset the view.\n\n[Demo](https://torfsen.github.io/leaflet.zoomhome/)\n\n\n## Usage\n\nSupported Leaflet versions are 0.7.x and later.\n\nThis plugin requires [Font-Awesome](https://fortawesome.github.io/Font-Awesome/):\n\n```xml\n\u003clink rel=\"stylesheet\" href=\"http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css\"/\u003e\n```\n\nCopy `Leaflet.zoomhome.min.js` and `Leaflet.zoomhome.css` from the `dist` folder to\nyour project folder and include them in your HTML (you need to include Leaflet before\nincluding the plugin):\n\n```xml\n\u003clink rel=\"stylesheet\" href=\"leaflet.zoomhome.css\"/\u003e\n\u003cscript src=\"leaflet.zoomhome.min.js\"\u003e\u003c/script\u003e\n```\n\nAlternatively, you can install the plugin via [Bower](http://bower.io):\n\n    bower install leaflet.zoomhome --save\n\nWhen you create your map, pass `{zoomControl: false}` to disable the standard\nzoom control:\n\n```js\nvar map = L.map('map', {zoomControl: false});\n```\n\nThen create the zoomhome-control and add it to the map:\n\n```js\nvar zoomHome = L.Control.zoomHome();\nzoomHome.addTo(map);\n```\n\n\n## Options\n\nYou can pass additional options when you create the control:\n\n```js\nvar zoomHome = L.Control.zoomHome({position: 'topright'});\n```\n\nIn addition to the [options supported by the standard zoom control](http://leafletjs.com/reference.html#control-zoom),\nthe zoomhome-control supports the following options:\n\n`zoomHomeIcon`: Font-Awesome icon name for the home button (default: `'home'`).\n\n`zoomHomeTitle`: Tooltip-text of the home button (default: `'Home'`).\n\n`homeCoordinates`: Coordinates on which the map is centered when the home button\nis pressed (default: the location which the map displayed when the control was\nadded to the map).\n\n`homeZoom`: The zoom level to which the map zooms when the home button is pressed\n(default: the zoom level that was active when the control was added to the map).\n\n\n## Changing the Home View\n\nYou can change the home view after the control has been created using the\nfollowing functions.\n\n`zoomHome.setHomeCoordinates(coordinates)`: If `coordinates` are given then\nthey define the new home coordinates. If no coordinates are given then the\ncurrent map center becomes the new home location. The home zoom level is not\nchanged.\n\n`zoomHome.setHomeZoom(zoom)`: If `zoom` is given then it defines the new home\nzoom. If no zoom is given then the current map zoom becomes the new home zoom.\nThe home coordinates are not changed.\n\n`zoomHome.setHomeBounds(bounds)`: If `bounds` are given then they define the\nnew home view (both zoom and center). If they are not given, the current map\nbounds become the new home.\n\n\n## Inspecting the Home View\n\nYou can get the home coordinates and zoom using the\n`zoomHome.getHomeCoordinates()` and `zoomHome.getHomeZoom()` functions,\nrespectively.\n\n\n## Change Log\n\nSee the file [CHANGELOG.md](CHANGELOG.md).\n\n\n## License\n\nBased on [code by toms](https://gis.stackexchange.com/a/127383/48264) and\nlicensed under [CC-BY-SA 3.0](http://creativecommons.org/licenses/by-sa/3.0/).\n\n\n## Development\n\nInstall all requirements using `npm install`.\n\nThe tests can be run via `grunt test` (test against the currently installed Leaflet version) or via `grunt test-all` (test against all supported Leaflet versions).\n\nLinting can be done via `grunt jshint`, and `grunt uglify` updates the minified JS file.\n\n`grunt` on its own is equivalent to running the `jshint`, `test-all` and `uglify` tasks.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorfsen%2Fleaflet.zoomhome","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftorfsen%2Fleaflet.zoomhome","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorfsen%2Fleaflet.zoomhome/lists"}