-
Notifications
You must be signed in to change notification settings - Fork 106
Description
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.