forked from kalyabin/yii2-select-google-map-location
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SelectMapLocationAssets.php
44 lines (39 loc) · 1.02 KB
/
SelectMapLocationAssets.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace kalyabin\maplocation;
use yii\web\AssetBundle;
/**
* SelectMapLocationWidget assets class
*
* @author Max Kalyabin <[email protected]>
* @package yii2-select-google-map-location
* @copyright (c) 2015, Max Kalyabin, http://github.com/kalyabin
*/
class SelectMapLocationAssets extends AssetBundle
{
public $sourcePath = '@vendor/kalyabin/yii2-select-google-map-location/js';
public $css = [];
public $js = [
'select-google-map-location.js',
];
public $depends = [
'yii\web\YiiAsset',
];
/**
* Google API Key
*
* @var string
*/
public static $googleMapApiKey;
/**
* @inheritdoc
*/
public static function register($view)
{
/* @var $view \yii\web\View */
$view->registerJsFile(
'https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=maps,places&loading=async&callback=initMap&key=' . self::$googleMapApiKey
// ,['defer' => true]
);
return parent::register($view);
}
}