{"id":30593360,"url":"https://github.com/techwithty/google-maps-two","last_synced_at":"2025-08-29T18:13:37.165Z","repository":{"id":311022927,"uuid":"1042148768","full_name":"TechWithTy/google-maps-two","owner":"TechWithTy","description":"Reusable Google Maps components and utils for React/Next.js (drawing tools, geometry helpers, advanced markers). Production-ready, typed, and composable.","archived":false,"fork":false,"pushed_at":"2025-08-21T17:37:56.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-21T18:31:11.195Z","etag":null,"topics":["components","drawing","geometry","google-maps","nextjs","react","typescript","ui","utils","web"],"latest_commit_sha":null,"homepage":"https://www.cybershoptech.com","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/TechWithTy.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-21T14:57:55.000Z","updated_at":"2025-08-21T17:38:00.000Z","dependencies_parsed_at":"2025-08-21T18:33:02.641Z","dependency_job_id":"fa7cd3b0-f3b0-45be-9a0f-7bd2a0435edf","html_url":"https://github.com/TechWithTy/google-maps-two","commit_stats":null,"previous_names":["techwithty/google-maps-two"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/TechWithTy/google-maps-two","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Fgoogle-maps-two","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Fgoogle-maps-two/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Fgoogle-maps-two/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Fgoogle-maps-two/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TechWithTy","download_url":"https://codeload.github.com/TechWithTy/google-maps-two/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechWithTy%2Fgoogle-maps-two/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272735304,"owners_count":24984283,"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-29T02:00:10.610Z","response_time":87,"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":["components","drawing","geometry","google-maps","nextjs","react","typescript","ui","utils","web"],"created_at":"2025-08-29T18:13:32.061Z","updated_at":"2025-08-29T18:13:37.157Z","avatar_url":"https://github.com/TechWithTy.png","language":"TypeScript","readme":"# google-maps-two (submodule)\n\nReusable Google Maps UI components and helpers for Next.js/React apps.\n\nThis package provides:\n- Components: `MapWithDrawing`, `MapsTestComposite`\n- Utils: bounds helpers for shapes and pin generation\n\nDirectory: `external/google-maps-two/`\n\n## Features\n- Load Google Maps JS API (with drawing, geometry, places, marker libs)\n- Draggable primary marker synced with app state\n- Drawing tools (polygon/rectangle/circle) with overlay UI\n- Fit bounds on apply; generate simulated pins within shape\n- Typed utils for shape bounds and point-in-shape checks\n\n## Installation\nUse it directly in this monorepo, or copy the folder into another project.\n\nPeer deps expected in the host app (see versions in root package.json):\n- react, react-dom\n- next (optional, but components are client components)\n- @react-google-maps/api\n- @types/google.maps (dev)\n\n## Environment variables\nProvide a Google Maps API key and (optionally) a Map ID for vector maps.\n\nCopy to your root `.env.local` (or similar):\n\n```\n# One of the two keys below is sufficient — choose your convention\nNEXT_PUBLIC_GMAPS_KEY=\"\"\nNEXT_PUBLIC_GOOGLE_MAPS_API_KEY=\"\"\n\n# Optional: map styling id from Google Cloud console\nNEXT_PUBLIC_GMAPS_MAP_ID=\"\"\n```\n\nYou can also use the `.env.example` in this folder as a reference.\n\n## Usage\nImport from the barrel export:\n\n```tsx\n\"use client\";\nimport { MapWithDrawing } from \"@/external/google-maps-two/components\";\n\nexport default function Example() {\n  const [center, setCenter] = useState({ lat: 39.7392, lng: -104.9903 });\n  const [pins, setPins] = useState\u003cgoogle.maps.LatLngLiteral[]\u003e([]);\n\n  return (\n    \u003cMapWithDrawing\n      apiKey={process.env.NEXT_PUBLIC_GMAPS_KEY || process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY || \"\"}\n      mapId={process.env.NEXT_PUBLIC_GMAPS_MAP_ID}\n      center={center}\n      onCenterChange={setCenter}\n      results={pins}\n      onResultsChange={setPins}\n      defaultZoom={12}\n      containerStyle={{ width: \"100%\", height: \"500px\" }}\n      centerChangeZoom={16}\n    /\u003e\n  );\n}\n```\n\nOr render the full demo page UI:\n\n```tsx\nimport MapsTestPage from \"@/app/maps-test/page\"; // already re-exported\n// or use directly\nimport { MapsTestComposite } from \"@/external/google-maps-two/components\";\n```\n\n## Exports\n- Components: `@/external/google-maps-two/components`\n  - `MapWithDrawing`\n  - `MapsTestComposite`\n- Utils: `@/external/google-maps-two/utils`\n  - `getBoundsFromShape`\n  - `isWithinCircle`\n  - `isWithinPolygon`\n  - `generatePinsWithinBounds`\n\n## Notes\n- Components assume TailwindCSS utility classes for styles, but work without Tailwind too.\n- The composite uses your UI kit (`@/components/ui/*`) and `NestedMapDialog`; if extracting to a separate repo, either:\n  - Move those into this package, or\n  - Replace with your own UI/props.\n\n## License\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechwithty%2Fgoogle-maps-two","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechwithty%2Fgoogle-maps-two","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechwithty%2Fgoogle-maps-two/lists"}