Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

LeafLetAsset.php 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC
  4. * @link http://2amigos.us
  5. * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  6. */
  7. namespace dosamigos\leaflet;
  8. use yii\web\AssetBundle;
  9. /**
  10. * LeafLetAsset Registers widget requires files. Please, use the following in order to override bundles for CDN:
  11. *
  12. * ```
  13. * return [
  14. * // ...
  15. * 'components' => [
  16. * 'bundles' => [
  17. * 'dosamigos\leaftlet\LeafLetAsset' => [
  18. * 'sourcePath' => null,
  19. * 'js' => [ 'http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js' ],
  20. * 'css' => [ 'http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css' ]
  21. * ]
  22. * ]
  23. * ]
  24. * ]
  25. * ```
  26. *
  27. * @author Antonio Ramirez <amigo.cobos@gmail.com>
  28. * @link http://www.ramirezcobos.com/
  29. * @link http://www.2amigos.us/
  30. * @package dosamigos\leaflet
  31. */
  32. class LeafLetAsset extends AssetBundle
  33. {
  34. public $sourcePath = '@bower/leaflet/dist';
  35. public $css = [
  36. 'leaflet.css'
  37. ];
  38. public function init()
  39. {
  40. $this->js = YII_DEBUG ? ['leaflet-src.js'] : ['leaflet.js'];
  41. }
  42. }