{"id":20833880,"url":"https://github.com/quexer69/yii2-google-api","last_synced_at":"2025-05-08T01:44:06.747Z","repository":{"id":26306894,"uuid":"29754866","full_name":"Quexer69/yii2-google-api","owner":"Quexer69","description":"A collection of google map api calls, staticmap, geocode, iframe map","archived":false,"fork":false,"pushed_at":"2017-08-14T11:38:04.000Z","size":24,"stargazers_count":2,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-08T01:43:59.642Z","etag":null,"topics":["geocoder","google-api","staticmap","yii2"],"latest_commit_sha":null,"homepage":null,"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/Quexer69.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":"2015-01-23T21:50:18.000Z","updated_at":"2017-04-02T13:43:41.000Z","dependencies_parsed_at":"2022-08-17T20:20:13.014Z","dependency_job_id":null,"html_url":"https://github.com/Quexer69/yii2-google-api","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quexer69%2Fyii2-google-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quexer69%2Fyii2-google-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quexer69%2Fyii2-google-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quexer69%2Fyii2-google-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Quexer69","download_url":"https://codeload.github.com/Quexer69/yii2-google-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252983757,"owners_count":21835758,"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":["geocoder","google-api","staticmap","yii2"],"created_at":"2024-11-18T00:17:13.026Z","updated_at":"2025-05-08T01:44:06.701Z","avatar_url":"https://github.com/Quexer69.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yii2 google api library \n-----------------------------\n\n[![Latest Stable Version](https://poser.pugx.org/quexer69/yii2-google-api/v/stable.svg)](https://packagist.org/packages/quexer69/yii2-google-api) [![Total Downloads](https://poser.pugx.org/quexer69/yii2-google-api/downloads.svg)](https://packagist.org/packages/quexer69/yii2-google-api) [![License](https://poser.pugx.org/quexer69/yii2-google-api/license.svg)](https://packagist.org/packages/quexer69/yii2-google-api)\n\nA collection of google map api calls, staticmap, geocode, iframe map\n\n...for Google API v3, PHP \u003e= 5.4.0, Yii 2.0.*\n\n\n## Installation\n\nThe preferred way to install this component is through [composer](http://getcomposer.org/download/).\n\nEither run\n\n```\nphp composer.phar require --prefer-dist quexer69/yii2-google-api \"2.0.*\"\n```\n\nor add\n\n```\n\"quexer69/yii2-google-api\": \"2.0.*\"\n```\n\nto the require section of your `composer.json` file.\n\n\n## Configuration\n\nin your app and/or console configuration file, add these\n\n\n```php\n'components' =\u003e [\n\n    // Google Maps Image and Geocode API settings for \\Yii::$app-\u003egoogleApi component\n    'googleApi'   =\u003e [\n            'class'             =\u003e 'quexer\\googleapi\\GoogleApiLibrary',\n            \n            // API Keys !!!\n            'staticmap_api_key' =\u003e '***************************************',\n            'geocode_api_key'   =\u003e '***************************************',\n            \n            // Set basePath\n            'webroot'           =\u003e '@webroot',\n            \n            // Image path and map iframe settings\n            'map_image_path'    =\u003e '/images/google_map',\n            'map_type'          =\u003e 'terrain',\n            'map_size'          =\u003e '520x350',\n            'map_sensor'        =\u003e false,\n            'map_zoom'          =\u003e 9,\n            'map_scale'         =\u003e 1,\n            'map_marker_color'  =\u003e 'red',\n            'map_iframe_width'  =\u003e '100%', // %, px, em\n            'map_iframe_height' =\u003e '500px',  // %, px, em\n            'map_language'        =\u003e 'de',\n            \n            // Debug\n            'quiet'             =\u003e false\n    ],\n    ...\n],\n```\n\n## Public Methods\n\n```php\n\\Yii::$app-\u003egoogleApi-\u003erenderMapIframe($address, $latlng, $iFrameWidth, $iFrameHeight)\n\n\\Yii::$app-\u003egoogleApi-\u003ecreateImage($address, $latlng, $setMarker)\n\n\\Yii::$app-\u003egoogleApi-\u003egetGeoCodeObject($address, $latlng)\n\n\\Yii::$app-\u003egoogleApi-\u003egetDistance($start, $finish, $unit)\n\n\\Yii::$app-\u003egoogleApi-\u003egetBounds($address)\n\n```\n\n## Usage\n\nOnce the component is installed, simply use it in your code by:\n\n```php\n// Use $address OR $latlng\n$address \t          = '70180 Stuttgart, Germany';\n$latlng \t          = '48.7632145,9.174027';\n\n```\n\n**Create a Google map image**\n\n```php\n$relFilePath          = \\Yii::$app-\u003egoogleApi-\u003ecreateImage($address, null, true);\n```\n\n**To simply get the Google geocode object**\n\n```php\n$relFilePath          = \\Yii::$app-\u003egoogleApi-\u003egetGeoCodeObject(null, $latlng);\n```\n\n**Render a Google map iframe**\n\n```php\n$iframeMarkup         = \\Yii::$app-\u003egoogleApi-\u003erenderMapIframe(null, $latlng);\n```\n\n**Calculate Distance between two geo points**\n\n```php\n$latlng_origin\t      = ['48.7632145','9.174027'];\n$latlng_destination\t  = ['48.4525334','9.468254'];\n$unit\t\t          = 'miles'; // 'miles' or 'km'\n\n$floatDistance        = \\Yii::$app-\u003egoogleApi-\u003egetDistance($latlng_origin, $latlng_destination, $unit);\n```\n\n## See also\n... a more extensive variant\n * [2amigos/yii2-google-maps-library](https://github.com/2amigos/yii2-google-maps-library)\n \n\n## Resources\n\n * [Google Maps API Reference](https://developers.google.com/maps/documentation/)\n * [Project on GitHub](Quexer69/yii2-google-api)\n * [Quexer69 Packagist Profile](https://packagist.org/packages/Quexer69/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquexer69%2Fyii2-google-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquexer69%2Fyii2-google-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquexer69%2Fyii2-google-api/lists"}