-
Notifications
You must be signed in to change notification settings - Fork 5
/
LeafLetAsset.php
46 lines (42 loc) · 1.09 KB
/
LeafLetAsset.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
45
46
<?php
/**
* @copyright Copyright (c) 2013 2amigOS! Consulting Group LLC
* @link http://2amigos.us
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
*/
namespace dosamigos\leaflet;
use yii\web\AssetBundle;
/**
* LeafLetAsset Registers widget requires files. Please, use the following in order to override bundles for CDN:
*
* ```
* return [
* // ...
* 'components' => [
* 'bundles' => [
* 'dosamigos\leaftlet\LeafLetAsset' => [
* 'sourcePath' => null,
* 'js' => [ 'http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js' ],
* 'css' => [ 'http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css' ]
* ]
* ]
* ]
* ]
* ```
*
* @author Antonio Ramirez <[email protected]>
* @link http://www.ramirezcobos.com/
* @link http://www.2amigos.us/
* @package dosamigos\leaflet
*/
class LeafLetAsset extends AssetBundle
{
public $sourcePath = '@vendor/2amigos/yii2-leaflet-extension/assets';
public $css = [
'leaflet/leaflet.css'
];
public function init()
{
$this->js = YII_DEBUG ? ['leaflet/leaflet-src.js'] : ['leaflet/leaflet.js'];
}
}