Return single POI if osmid filter set

This commit is contained in:
Skylar Ittner 2019-05-27 21:36:57 -06:00
parent 28b3d81d0a
commit 610e88fdaf

View File

@ -126,7 +126,12 @@ $query = ob_get_contents();
ob_clean(); ob_clean();
$results = $database->query($query)->fetchAll(); $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"]) { if ($SETTINGS["debug"]) {
$geojson["query"] = $query; $geojson["query"] = $query;