{"id":16346935,"url":"https://github.com/simonsmith/google-map-geocode","last_synced_at":"2025-11-09T02:30:23.828Z","repository":{"id":2940346,"uuid":"3952608","full_name":"simonsmith/Google-Map-Geocode","owner":"simonsmith","description":"PHP class that allows retrieval of address data from the Google Maps API","archived":false,"fork":false,"pushed_at":"2012-04-06T19:25:21.000Z","size":88,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-18T08:36:36.206Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","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/simonsmith.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":"2012-04-06T19:07:27.000Z","updated_at":"2016-10-23T09:32:40.000Z","dependencies_parsed_at":"2022-09-15T11:04:02.996Z","dependency_job_id":null,"html_url":"https://github.com/simonsmith/Google-Map-Geocode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsmith%2FGoogle-Map-Geocode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsmith%2FGoogle-Map-Geocode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsmith%2FGoogle-Map-Geocode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsmith%2FGoogle-Map-Geocode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonsmith","download_url":"https://codeload.github.com/simonsmith/Google-Map-Geocode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239565664,"owners_count":19660158,"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-10-11T00:38:42.095Z","updated_at":"2025-11-09T02:30:23.786Z","avatar_url":"https://github.com/simonsmith.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Map Geocode\n\nReturns an object of address data from [the Google maps API](https://developers.google.com/maps/documentation/geocoding/).\n\n## Usage\n\nThe class provides two methods to retrieve addresses:\n\n```php\n\u003c?\n$geo = new Google_Map_Geocode();\n$geo-\u003eget_address('London, UK');\n$geo-\u003eget_latlong('51.535879,0.696966');\n?\u003e\n```\n\n### Default URL parameters\n\nThe default parameters are:\n\n```php\n\u003c?\narray(\n    'query' =\u003e 'address' /* or */ 'latlng' // This is added depending on which method is called\n    'type' =\u003e 'address',\n    'sensor' =\u003e 'false'\n);\n?\u003e\n```\n\nThe following URL is substituted with the params using [vsprintf](http://php.net/manual/en/function.vsprintf.php):\n\n    http://maps.googleapis.com/maps/api/geocode/json?%2$s=%1$s\u0026sensor=%3$s\n\n### Adding your own parameters\n\nInstantiate the object with the new url as an argument. In this example the default region that is searched will be set to the UK:\n\n```php\n\u003c?\n$geo = new Google_Map_Geocode('http://maps.googleapis.com/maps/api/geocode/json?%2$s=%1$s\u0026sensor=%3$s\u0026region=%4$s');\n\n$geo-\u003eget_address('London', array(\n    'region' =\u003e 'uk'\n));\n?\u003e\n```\n\n## Notes\n\nPlease respect the [Google Maps API usage agreement](https://developers.google.com/maps/terms#section_10_12)\n\nI intend to improve the way additional URL parameters are added at some point, but if you have any suggestions please make a pull request or open an issue.\nCheers\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonsmith%2Fgoogle-map-geocode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonsmith%2Fgoogle-map-geocode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonsmith%2Fgoogle-map-geocode/lists"}