Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configuration option for handling tile not found #142

Open
jasonbrice opened this issue Feb 13, 2015 · 0 comments
Open

Add configuration option for handling tile not found #142

jasonbrice opened this issue Feb 13, 2015 · 0 comments

Comments

@jasonbrice
Copy link

Summary

Add options for 404 handling.

Currently Tile.bones asks the model for a tile with the z, x, y coordinates. If not found, it returns an error 404. On most browsers this puts the ugly 'file not found' default icon where the tile should be. It would be nice to have the option to show nothing if the tile does not exist.

It is of course possible to modify Tile.bones with something like this:

   var blank = path.join(
        path.dirname(res.model.source.filename),
        "blank.png");

   _.extend(headers, options || {});

   fs.createReadStream(blank).pipe(res);

(Or, to update the client-side tile rendering library to do something similar) but it might be more elegant as a config option?

Use case

Consider FAA sectional charts. These have coverage only through N. America. It would be nice to have a base layer, e.g., World Light, then overlay navigational data (where it exists) on top of that. But what if you zoom into an area of Australia? You could either store a transparent tile for every possible coordinate, or get the ugly 404 icon.

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

No branches or pull requests

1 participant