From 0e2b8dd3cd84d4e5b1290579106b9f8afc4522f7 Mon Sep 17 00:00:00 2001 From: David Molineus Date: Thu, 1 Nov 2018 16:01:16 +0100 Subject: [PATCH 1/4] Fix missing marker cluster icon. --- CHANGELOG.md | 6 ++++++ src/Bundle/Resources/config/layers.yml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d9a0c2..a4d94d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 3.1.1 - TBD + +[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.0...hotfix/3.1.1) + + - Fix missing marker cluster icon + ## 3.1.0 - 2018-01-11 [Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.4...3.1.0) diff --git a/src/Bundle/Resources/config/layers.yml b/src/Bundle/Resources/config/layers.yml index c6dcc77..5e65deb 100644 --- a/src/Bundle/Resources/config/layers.yml +++ b/src/Bundle/Resources/config/layers.yml @@ -32,7 +32,7 @@ parameters: markercluster: children: true - icon: 'bundles/netzmachtcontaoleaflet/img/markercluster.png' + icon: 'bundles/netzmachtcontaoleaflet/img/cluster.png' tile: children: false From 57ba63556aee529697e515f0a104005450aadf9a Mon Sep 17 00:00:00 2001 From: David Molineus Date: Thu, 6 Dec 2018 10:37:39 +0100 Subject: [PATCH 2/4] Ignore markers without defined coordinates. --- CHANGELOG.md | 3 +++ src/Model/MarkerModel.php | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4d94d8..aa850f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.0...hotfix/3.1.1) +### Fixed + - Fix missing marker cluster icon + - Ignore markers without coordinates ## 3.1.0 - 2018-01-11 diff --git a/src/Model/MarkerModel.php b/src/Model/MarkerModel.php index f1159ba..9b10323 100644 --- a/src/Model/MarkerModel.php +++ b/src/Model/MarkerModel.php @@ -44,7 +44,18 @@ class MarkerModel extends AbstractActiveModel public static function findByFilter($pid, ?Filter $filter = null) { if (!$filter) { - return static::findActiveBy('pid', $pid, ['order' => 'sorting']); + $table = static::getTable(); + + return static::findBy( + [ + $table . '.active=1', + $table . '.pid=?', + $table . '.latitude>0', + $table . '.longitude>0', + ], + [$pid], + ['order' => 'sorting'] + ); } switch (true) { From 878492c0b1335954a5f18f00a215a994d6e476be Mon Sep 17 00:00:00 2001 From: David Molineus Date: Fri, 7 Dec 2018 11:22:16 +0100 Subject: [PATCH 3/4] Fix Code style. --- src/Listener/Dca/LeafletDcaListener.php | 1 + src/Model/MarkerModel.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Listener/Dca/LeafletDcaListener.php b/src/Listener/Dca/LeafletDcaListener.php index a8737ee..871574c 100644 --- a/src/Listener/Dca/LeafletDcaListener.php +++ b/src/Listener/Dca/LeafletDcaListener.php @@ -122,6 +122,7 @@ class LeafletDcaListener $data['marker'] = json_encode($latLng); } catch (\Exception $e) { // LatLng throws an exception of value could not be created. Just let the value empty when. + $data['marker'] = null; } return $this->templateEngine->render('toolkit:be:be_leaflet_geocode.html5', $data); diff --git a/src/Model/MarkerModel.php b/src/Model/MarkerModel.php index 9b10323..8064a1d 100644 --- a/src/Model/MarkerModel.php +++ b/src/Model/MarkerModel.php @@ -44,7 +44,7 @@ class MarkerModel extends AbstractActiveModel public static function findByFilter($pid, ?Filter $filter = null) { if (!$filter) { - $table = static::getTable(); + $table = static::getTable(); return static::findBy( [ From 1ba19f63b1687d43fdea7f96368e365a37991c26 Mon Sep 17 00:00:00 2001 From: David Molineus Date: Fri, 7 Dec 2018 11:22:23 +0100 Subject: [PATCH 4/4] Prepare release. --- CHANGELOG.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa850f2..c5c5723 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,16 +6,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## 3.1.1 - TBD +## 3.1.1 - 2018-12-07 -[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.0...hotfix/3.1.1) +[Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.0...3.1.1) ### Fixed - - Fix missing marker cluster icon - - Ignore markers without coordinates + - Fix missing marker cluster icon. + - Ignore markers without coordinates to prevent uncaught exception caused by invalid coordinates. -## 3.1.0 - 2018-01-11 +## 3.1.0 - 2018-11-01 [Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.0.4...3.1.0)