From b48d5c48b728702da6e7298a668f7bef369eca89 Mon Sep 17 00:00:00 2001 From: HendrikLynx Date: Sun, 2 May 2021 13:02:43 +0000 Subject: [PATCH 1/3] Use bower for always up to date resources, and move 'js' part to allow overwriting --- composer.json | 3 ++- src/MarkerClusterAsset.php | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) 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..90c77b5 100644 --- a/src/MarkerClusterAsset.php +++ b/src/MarkerClusterAsset.php @@ -21,8 +21,12 @@ class MarkerClusterAsset extends AssetBundle { public $css = [ - 'css/MarkerCluster.css', - 'css/MarkerCluster.Default.css' + 'MarkerCluster.css', + 'MarkerCluster.Default.css' + ]; + + public $js = [ + YII_DEBUG ? 'leaflet.markercluster-src.js' : 'js/leaflet.markercluster.js' ]; public $depends = [ @@ -32,7 +36,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'; + } } From 8275b979655204e0a91cac79b8a3ff83fcb5766f Mon Sep 17 00:00:00 2001 From: HendrikLynx Date: Sun, 2 May 2021 13:32:34 +0000 Subject: [PATCH 2/3] Change vendor name to allow package upload to packagist --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b85837e..2c14a13 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "2amigos/yii2-leaflet-markercluster-plugin", + "name": "hendriklynx/yii2-leaflet-markercluster-plugin", "description": "Yii2 LeafLet Plugin to provide beautiful, sophisticated, high performance marker clustering solution with smooth animations and lots of great features.", "keywords": [ "2amigos", From 319c29b784c36028ef2b9d7075c5794ac69fa14e Mon Sep 17 00:00:00 2001 From: HendrikLynx Date: Mon, 3 May 2021 10:34:40 +0000 Subject: [PATCH 3/3] Fix for prod enviroment 'js' --- src/MarkerClusterAsset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MarkerClusterAsset.php b/src/MarkerClusterAsset.php index 90c77b5..25eaaf7 100644 --- a/src/MarkerClusterAsset.php +++ b/src/MarkerClusterAsset.php @@ -26,7 +26,7 @@ class MarkerClusterAsset extends AssetBundle ]; public $js = [ - YII_DEBUG ? 'leaflet.markercluster-src.js' : 'js/leaflet.markercluster.js' + YII_DEBUG ? 'leaflet.markercluster-src.js' : 'leaflet.markercluster.js' ]; public $depends = [