Fix legend mismatch, make sure type is always an int
This commit is contained in:
parent
58024ecee0
commit
8a536f6969
@ -53,13 +53,14 @@ $terrainstrings = [
|
||||
10 => "Grassland",
|
||||
11 => "Cropland",
|
||||
12 => "Bare Ground",
|
||||
13 => "Urban and Built"
|
||||
13 => "Urban and Built",
|
||||
14 => "Urban and Built"
|
||||
];
|
||||
|
||||
if ($failtowater) {
|
||||
$terrainid = 0;
|
||||
} else {
|
||||
$terrainid = $database->select('terrain', 'type', ["AND" => ["latitude" => $finallat, "longitude" => $finallong]])[0];
|
||||
$terrainid = (int) $database->select('terrain', 'type', ["AND" => ["latitude" => $finallat, "longitude" => $finallong]])[0];
|
||||
}
|
||||
$out = ["status" => "OK", "type" => $terrainid, "latitude" => $finallat, "longitude" => $finallong, "name" => $terrainstrings[$terrainid]];
|
||||
echo json_encode($out);
|
||||
|
Loading…
x
Reference in New Issue
Block a user