Add street autocomplete API

master
Skylar Ittner 1 year ago
parent 8c20a29057
commit dd161cc7f2

@ -26,6 +26,13 @@ $APIS = [
"longitude" => "/\-?[0-9]{1,3}(\.[0-9]{0,10})?/"
]
],
"gis/streetautocomplete" => [
"load" => "gis.streetautocomplete.php",
"vars" => [
"street" => "",
"zip" => ""
]
],
"gis/fixphrase" => [
"load" => "gis.fixphrase.php",
"vars" => [

@ -0,0 +1,16 @@
<?php
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
$resultjson = file_get_contents("http://192.168.130.22/?zip=" . $VARS["zip"] . "&address=" . $VARS["street"]);
$results = json_decode($resultjson, true);
if ($results["status"] != "OK") {
exitWithJson($results);
}
exitWithJson(["status" => "OK", "results" => $results["results"]]);
Loading…
Cancel
Save