{"id":16487669,"url":"https://github.com/404-html/modern-pan-zoom","last_synced_at":"2025-08-02T11:33:09.079Z","repository":{"id":65001330,"uuid":"579508939","full_name":"404-html/modern-pan-zoom","owner":"404-html","description":"Simple, Google Maps like, pan/zoom for the web","archived":false,"fork":false,"pushed_at":"2022-12-21T09:55:27.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-26T16:04:57.330Z","etag":null,"topics":["google","maps","pan","zoom"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/404-html.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-12-17T23:17:05.000Z","updated_at":"2022-12-18T21:13:35.000Z","dependencies_parsed_at":"2023-01-13T15:12:33.393Z","dependency_job_id":null,"html_url":"https://github.com/404-html/modern-pan-zoom","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/404-html/modern-pan-zoom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/404-html%2Fmodern-pan-zoom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/404-html%2Fmodern-pan-zoom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/404-html%2Fmodern-pan-zoom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/404-html%2Fmodern-pan-zoom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/404-html","download_url":"https://codeload.github.com/404-html/modern-pan-zoom/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/404-html%2Fmodern-pan-zoom/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268378965,"owners_count":24240907,"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-08-02T02:00:12.353Z","response_time":74,"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":["google","maps","pan","zoom"],"created_at":"2024-10-11T13:35:33.923Z","updated_at":"2025-08-02T11:33:09.059Z","avatar_url":"https://github.com/404-html.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple, Google Maps like, pan/zoom for the web\n\n## [Production demo](https://recordscanner.com/user/record-scanner/collection)\n\nCooperative Gesture Handler, makes content of any element behaving like [Embed Google Maps](https://developers.google.com/maps/documentation/embed/get-started).\n\non 📱 - detects single finger gesture, doesn't block the scroll\n\non 💻 - detects wheel, zooms when ⌘/ctrl is pressed\n\n## Installation\n\n```\nyarn add modern-pan-zoom\n```\n\n## Example usage in React\n\n```js\nimport ModernPanZoom from \"modern-pan-zoom\";\nimport { useEffect, useRef } from \"react\";\n\nexport default function App() {\n  const elRef = useRef(null);\n\n  useEffect(() =\u003e {\n    if (!elRef.current) return;\n    const panZoom = new ModernPanZoom(elRef.current, {\n      autoScale: true, // sets initial zoom for child(s) to fit the parent, default: false\n      onHint: (type, acknowledge) =\u003e {\n        type === \"pan\" \u0026\u0026 alert(\"Use two fingers to navigate\");\n        type === \"wheel\" \u0026\u0026 alert(\"Use ⌘ + scroll to zoom\");\n\n        // onHint() will not be called again until acknowledge() is executed\n        setTimeout(acknowledge, 2000);\n      },\n    });\n  }, []);\n\n  return (\n    \u003cdiv ref={elRef}\u003e\n      \u003ch1\u003eWooohooooo!!!\u003c/h1\u003e\n    \u003c/div\u003e\n  );\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F404-html%2Fmodern-pan-zoom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F404-html%2Fmodern-pan-zoom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F404-html%2Fmodern-pan-zoom/lists"}