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) {