Ignore markers without defined coordinates.

This commit is contained in:
David Molineus
2018-12-06 10:37:39 +01:00
parent 0e2b8dd3cd
commit 57ba63556a
2 changed files with 15 additions and 1 deletions

View File

@@ -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) [Full Changelog](https://github.com/netzmacht/contao-leaflet-maps/compare/3.1.0...hotfix/3.1.1)
### Fixed
- Fix missing marker cluster icon - Fix missing marker cluster icon
- Ignore markers without coordinates
## 3.1.0 - 2018-01-11 ## 3.1.0 - 2018-01-11

View File

@@ -44,7 +44,18 @@ class MarkerModel extends AbstractActiveModel
public static function findByFilter($pid, ?Filter $filter = null) public static function findByFilter($pid, ?Filter $filter = null)
{ {
if (!$filter) { 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) { switch (true) {