From 7a1ee9934522f0ed4535a2ad4c3429b7121d90cf Mon Sep 17 00:00:00 2001 From: marc tobias Date: Mon, 9 Apr 2018 14:24:31 +0200 Subject: [PATCH] return centroid on geojson format --- lib/template/details-json.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/template/details-json.php b/lib/template/details-json.php index 3cf233d4..288c914c 100644 --- a/lib/template/details-json.php +++ b/lib/template/details-json.php @@ -32,9 +32,10 @@ $aPlaceDetails['rank_address'] = (int) $aPointDetails['rank_address']; $aPlaceDetails['rank_search'] = (int) $aPointDetails['rank_search']; $aPlaceDetails['isarea'] = ($aPointDetails['isarea'] == 't'); -$aPlaceDetails['lat'] = (float) $aPointDetails['lat']; -$aPlaceDetails['lon'] = (float) $aPointDetails['lon']; - +$aPlaceDetails['centroid'] = array( + 'type' => 'Point', + 'coordinates' => array( (float) $aPointDetails['lon'], (float) $aPointDetails['lat'] ) +); $aPlaceDetails['geometry'] = json_decode($aPointDetails['asgeojson']); -- 2.39.5