diff --git a/composer.json b/composer.json index fbbd429..b85837e 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,8 @@ "source": "https://github.com/2amigos/yii2-leaflet-markercluster-plugin" }, "require": { - "2amigos/yii2-leaflet-extension": "~1.0" + "2amigos/yii2-leaflet-extension": "~1.0", + "bower-asset/leaflet.markercluster": "~1.0" }, "require-dev": { "phpunit/phpunit": "4.*" diff --git a/src/MarkerClusterAsset.php b/src/MarkerClusterAsset.php index c29612e..b688c3e 100644 --- a/src/MarkerClusterAsset.php +++ b/src/MarkerClusterAsset.php @@ -21,8 +21,8 @@ class MarkerClusterAsset extends AssetBundle { public $css = [ - 'css/MarkerCluster.css', - 'css/MarkerCluster.Default.css' + 'MarkerCluster.css', + 'MarkerCluster.Default.css' ]; public $depends = [ @@ -32,7 +32,7 @@ class MarkerClusterAsset extends AssetBundle public function init() { - $this->sourcePath = __DIR__ . '/assets'; - $this->js = YII_DEBUG ? ['js/leaflet.markercluster-src.js'] : ['js/leaflet.markercluster.js']; + $this->sourcePath = \Yii::getAlias('@bower').'/leaflet.markercluster/dist'; + $this->js = YII_DEBUG ? ['leaflet.markercluster-src.js'] : ['leaflet.markercluster.js']; } }