Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

VM error when fetching grid.json #62

Closed
heaversm opened this issue Dec 17, 2015 · 4 comments
Closed

VM error when fetching grid.json #62

heaversm opened this issue Dec 17, 2015 · 4 comments

Comments

@heaversm
Copy link

Hi - I'm getting the attached
screen shot 2015-12-17 at 4 06 23 pm
console error when attempting to access my .mbtiles in javascript

The output of that json file looks like this:

screen shot 2015-12-17 at 4 06 38 pm

The error appears to be tied to these lines of code:

          //adds legend (data) to output
          $grid .= ',"data":{';
          $result = $this->db->query('SELECT key_name as key, key_json as json FROM grid_data WHERE zoom_level=' . $z . ' and tile_column=' . $x . ' and tile_row=' . $y);
          while ($r = $result->fetch(PDO::FETCH_ASSOC)) {
            $grid .= '"' . $r['key'] . '":' . $r['json'] . ',';
          }
          $grid = rtrim($grid, ',') . '}}';

Any idea what's going on or how to suppress these errors?

@klokan
Copy link
Member

klokan commented Dec 17, 2015

Not enough information to help you, I am afraid...

Is it related to legend?
Do you have a public URL where this error is visible?

@heaversm
Copy link
Author

Yes - the url is http://107.170.120.88/map

@heaversm
Copy link
Author

The only way I could find a way to get rid of this error was to do this:

$grid .= '{"data":{';
          $result = $this->db->query('SELECT key_name as key, key_json as json FROM grid_data WHERE zoom_level=' . $z . ' and tile_column=' . $x . ' and tile_row=' . $y);
          while ($r = $result->fetch(PDO::FETCH_ASSOC)) {
            $grid .= '"' . $r['key'] . '":' . $r['json'] . ',';
          }
          $grid = rtrim($grid, ',') . '}}';

But I'm guessing if any data were returned for the grid, this would not append the data properly. Is there a better way to disregard the grid? I'm not using one, so I'm not sure why the mbtileset would be including one (or failing the check).

@daliborjanak
Copy link
Collaborator

It was actualy bug in new versions of PHP related with change behavior of PDO response. We also have it, see: http://cynefin.archiveswales.org.uk/tileserver/cynefin-parishes/2/3/1.grid.json but our clients don't request grid tiles out of boundingbox so we could not detect this.

I found it and fix it together with another bug (f5408fd) related with last hybrid tile changes. It was hard to debug two bugs together :-(.

For future: Please turn on debuging on server. Send us your vesion of PHP etc. It will save our time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants