Premier jet de la carte des POIs

This commit is contained in:
leosw
2026-01-19 20:38:02 +01:00
parent e1aa647fce
commit 04ecae8211
4 changed files with 105 additions and 5 deletions

View File

@@ -99,6 +99,28 @@ switch ($controller->splitted_url[1]) {
}
break;
case "api_list":
header("Content-Type: application/json; charset=utf-8");
$pois = new Kabano\Pois();
$pois->listPois();
$out = [];
foreach ($pois->objs as $poi) {
$out[] = [
"id" => $poi->content_id,
"name" => $poi->name,
"lat" => floatval($poi->lat),
"lon" => floatval($poi->lon),
"type" => $poi->poi_type,
"permalink" => $poi->permalink
];
}
echo json_encode($out, JSON_UNESCAPED_UNICODE);
break;
default:
// Affichage / édition / suppression dun POI
if ($poi->checkPermalink($controller->splitted_url[1], $user->rankIsHigher("premium"))) {