added new way to select areas for shipping note
This commit is contained in:
@@ -452,15 +452,25 @@ class WarehouseShippingNoteController extends TTCrud {
|
||||
}
|
||||
$parsedDisplayNameParts[] = $part;
|
||||
}
|
||||
$out[] = ['value' => $entry['lat'] . "," . $entry['lon'], 'text' => implode(',', $parsedDisplayNameParts)];
|
||||
|
||||
if (!empty($out)) {
|
||||
foreach ($out as $key => $value) {
|
||||
if ($value['text'] === implode(',', $parsedDisplayNameParts)) {
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
$out[] = ['value' => $entry['lat'] . "," . $entry['lon'] . (!isset($entry['house_number']) ? ", area" : ""), 'text' => implode(',', $parsedDisplayNameParts)];
|
||||
}
|
||||
|
||||
|
||||
self::returnJson($out);
|
||||
}
|
||||
|
||||
protected function geoReverseAction() {
|
||||
$lat = $this->request->lat;
|
||||
$lon = $this->request->lon;
|
||||
$url = "https://nominatim.haid.in/reverse?lat=$lat&lon=$lon&format=json";
|
||||
$url = "https://nominatim.haid.in/reverse?lat=$lat&lon=$lon&format=json&addressdetails=1";
|
||||
$data = json_decode(file_get_contents($url), true);
|
||||
self::returnJson(is_array($data) ? $data : ['data' => $data]);
|
||||
}
|
||||
@@ -468,6 +478,7 @@ class WarehouseShippingNoteController extends TTCrud {
|
||||
|
||||
//TODO: export this to an api class for openstreetmap
|
||||
protected function getDistanceAction() {
|
||||
$this->request->to = str_replace("Gebiet ", "", $this->request->to);
|
||||
$filename = TEMP_DIR . "/OpenStreetMap/" . urlencode($this->request->from) . "-" . urlencode($this->request->to) . ".json";
|
||||
|
||||
if (file_exists($filename)) {
|
||||
|
||||
Reference in New Issue
Block a user