10 public static function getLatLon (
string $address): array {
11 require_once
'base/Ego_Http.php';
13 $http->get(
'https://nominatim.openstreetmap.org/search?' . http_build_query([
18 'User-Agent' => $_SERVER[
'HTTP_USER_AGENT']
21 if (!empty($http->json) && is_object($http->json[0])) {
23 'lati' => $http->json[0]->lat,
24 'long' => $http->json[0]->lon
38 public static function getAddress (
float $lat,
float $lon) {
39 require_once
'base/Ego_Http.php';
41 $http->get(
'https://nominatim.openstreetmap.org/reverse?' . str_replace(
",",
".", implode(
"&",[
48 'User-Agent' => $_SERVER[
'HTTP_USER_AGENT']
51 if (!empty($http->json)) {
static getLatLon(string $address)
static getAddress(float $lat, float $lon)