From 610e88fdaf7fccc2430315547acefce073d106da Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Mon, 27 May 2019 21:36:57 -0600 Subject: [PATCH] Return single POI if osmid filter set --- index.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 8653d17..fdd6035 100644 --- a/index.php +++ b/index.php @@ -126,7 +126,12 @@ $query = ob_get_contents(); ob_clean(); $results = $database->query($query)->fetchAll(); -$geojson = getgeojson($results); +// If we're looking for a specific location by OSM ID +if (!empty($where["osmid"])) { + $geojson = getgeojson($results[0]); +} else { + $geojson = getgeojson($results); +} if ($SETTINGS["debug"]) { $geojson["query"] = $query;