mirror of
https://github.com/klokantech/tileserver-php.git
synced 2025-08-04 05:37:57 +02:00
Issue Malformed UTFGrid (?) fixed. Fixes #26
This commit is contained in:
@@ -334,7 +334,7 @@ class Server {
|
|||||||
$result = $this->db->query('SELECT grid FROM grids WHERE tile_column = ' . $x . ' AND tile_row = ' . $y . ' AND zoom_level = ' . $z);
|
$result = $this->db->query('SELECT grid FROM grids WHERE tile_column = ' . $x . ' AND tile_row = ' . $y . ' AND zoom_level = ' . $z);
|
||||||
if (!isset($result) || $result === FALSE) {
|
if (!isset($result) || $result === FALSE) {
|
||||||
header('Access-Control-Allow-Origin: *');
|
header('Access-Control-Allow-Origin: *');
|
||||||
echo 'grid({error});';
|
echo '{}';
|
||||||
die;
|
die;
|
||||||
} else {
|
} else {
|
||||||
$data = $result->fetchColumn();
|
$data = $result->fetchColumn();
|
||||||
@@ -350,12 +350,13 @@ class Server {
|
|||||||
}
|
}
|
||||||
$grid = rtrim($grid, ',') . '}}';
|
$grid = rtrim($grid, ',') . '}}';
|
||||||
header('Access-Control-Allow-Origin: *');
|
header('Access-Control-Allow-Origin: *');
|
||||||
if (isset($_GET['callback'])) {
|
|
||||||
|
if (isset($_GET['callback']) && !empty($_GET['callback'])) {
|
||||||
header("Content-Type:text/javascript charset=utf-8");
|
header("Content-Type:text/javascript charset=utf-8");
|
||||||
echo $_GET['callback'] . '(' . $grid . ');';
|
echo $_GET['callback'] . '(' . $grid . ');';
|
||||||
} else {
|
} else {
|
||||||
header("Content-Type:text/javascript; charset=utf-8");
|
header("Content-Type:text/javascript; charset=utf-8");
|
||||||
echo 'grid(' . $grid . ');';
|
echo $grid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
|
Reference in New Issue
Block a user