Skip to content

Commit

Permalink
do not render a bitmap when the vector tile contains no features
Browse files Browse the repository at this point in the history
Simply hardlink the empty tile and serve that.
  • Loading branch information
DerDakon committed Mar 17, 2016
1 parent 7a94b91 commit fe47f1c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions bitmaptilerequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,16 @@ BitmapTilerequest.prototype =
if (err)
self.tile.warn('Vector tile could not be saved.');

self.tile.debug('Rendering bitmap tile with style '+self.tile.style);
self.tile.render(renderCallback);
if (self.data.features.length === 0)
{
self.tile.debug('Vector tile without features, serving empty PNG tile for style ' + self.tile.style);
renderCallback(false, null);
}
else
{
self.tile.debug('Rendering bitmap tile with style ' + self.tile.style);
self.tile.render(renderCallback);
}
});
});
}
Expand Down

0 comments on commit fe47f1c

Please sign in to comment.