PHP code example of kossmoss / yii2-google-maps-api

1. Go to this page and download the library: Download kossmoss/yii2-google-maps-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kossmoss / yii2-google-maps-api example snippets


	'components' => [
		...
		'assetManager' => [
			'bundles' => [
				'kossmoss\GoogleMaps\GoogleMapsAsset' => [
					'apiKey' => 'YOUR_API_KEY_HERE',   // get at https://developers.google.com/maps/documentation/javascript/get-api-key
					'language' => 'ru', // use language code supported by Google Maps API  (default: en)
				],
			],
		],
		...
	],


/* @var $this yii\web\View */
\kossmoss\GoogleMaps\GoogleMapsAsset::register($this);

use kossmoss\GoogleMaps\GoogleMaps;

...

$coords = GoogleMaps::coordsByAddress("Lisboa, Portugal");