From fdda1ea6906c113f8ee1409ee18506f28d1914f6 Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 17 Feb 2025 16:17:02 +0100 Subject: [PATCH] Corrige un bug --- src/Controller/MapController.php | 2 +- src/Entity/Task.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Controller/MapController.php b/src/Controller/MapController.php index 986e2e6..ef3db85 100644 --- a/src/Controller/MapController.php +++ b/src/Controller/MapController.php @@ -26,7 +26,7 @@ class MapController extends AbstractController // TODO dans le cas d’un nœud il n’y a pas de bounds mais on doit // pouvoir trouver les coins d’une bbox autour sans trop de difficultés - if (isset($element['bounds'])) { + if (isset($element['bounds']) and isset($element['type'])) { $josmCommands['load_and_zoom'] = [ 'bottom' => $element['bounds']['minlat'], 'top' => $element['bounds']['maxlat'], diff --git a/src/Entity/Task.php b/src/Entity/Task.php index 0908be4..aa8e2ca 100644 --- a/src/Entity/Task.php +++ b/src/Entity/Task.php @@ -166,7 +166,11 @@ class Task public function hasGeojson(): bool { - return isset($this->geojson); + return ( + isset($this->geojson) + and !empty($this->geojson) + and ($this->geojson !== '{}') + ); } public function getGeojson(): ?string