{"id":16595780,"url":"https://github.com/1000ch/x-geolocation","last_synced_at":"2025-10-29T12:30:38.430Z","repository":{"id":20896193,"uuid":"24183697","full_name":"1000ch/x-geolocation","owner":"1000ch","description":"Declarative Geolocation API as Web Components.","archived":false,"fork":false,"pushed_at":"2023-03-14T17:37:50.000Z","size":907,"stargazers_count":6,"open_issues_count":4,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-05-02T05:56:00.677Z","etag":null,"topics":["geolocation","web-components"],"latest_commit_sha":null,"homepage":"https://1000ch.github.io/x-geolocation","language":"HTML","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/1000ch.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}},"created_at":"2014-09-18T10:18:04.000Z","updated_at":"2021-10-10T12:49:54.000Z","dependencies_parsed_at":"2023-01-13T21:12:03.652Z","dependency_job_id":"d3b863c1-4cd4-49c3-9e59-9dddd1330353","html_url":"https://github.com/1000ch/x-geolocation","commit_stats":{"total_commits":75,"total_committers":3,"mean_commits":25.0,"dds":0.2533333333333333,"last_synced_commit":"f931befd2ca4c953e31f514afd6395ddc9ab02e8"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1000ch%2Fx-geolocation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1000ch%2Fx-geolocation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1000ch%2Fx-geolocation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1000ch%2Fx-geolocation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1000ch","download_url":"https://codeload.github.com/1000ch/x-geolocation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219857757,"owners_count":16556056,"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":["geolocation","web-components"],"created_at":"2024-10-11T23:51:35.182Z","updated_at":"2025-10-29T12:30:38.048Z","avatar_url":"https://github.com/1000ch.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# x-geolocation ![GitHub Actions Status](https://github.com/1000ch/x-geolocation/workflows/test/badge.svg)\n\n\u003e Declarative Geolocation API as Web Components.\n\n## Install\n\nUsing [npm](https://www.npmjs.org/package/x-geolocation):\n\n```sh\n$ npm install x-geolocation\n```\n\n## Usage\n\nImport `XGeolocation` and register it.\n\n```html\n\u003cscript type=\"module\"\u003e\nimport XGeolocation from 'https://unpkg.com/x-geolocation';\n\ncustomElements.define('x-geolocation', XGeolocation);\n\u003c/script\u003e\n```\n\nPut `\u003cx-geolocation\u003e` tag.\n\n```html\n\u003cx-geolocation\u003e\u003c/x-geolocation\u003e\n```\n\n### Monitoring position change\n\nTo monitor position changing, execute `monitorPosition()` function.\n\n```js\ndocument.querySelector('x-geolocation').monitorPosition();\n```\n\nOr set `monitor` attribute.\n\n```html\n\u003cx-geolocation monitor\u003e\u003c/x-geolocation\u003e\n```\n\n### Handle position changes\n\nHandle `positionchange` event using `addEventListener()`.\n\n```js\ndocument.querySelector('x-geolocation').addEventListener('positionchange', e =\u003e {\n  console.log('latitude:', e.detail.latitude);\n  console.log('longitude:', e.detail.longitude)\n});\n```\n\n## License\n\n[MIT](https://1000ch.mit-license.org) © [Shogo Sensui](https://github.com/1000ch)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1000ch%2Fx-geolocation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1000ch%2Fx-geolocation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1000ch%2Fx-geolocation/lists"}