Skip to content

Commit

Permalink
PointObjectLayer: Don't add empty tiles
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Jul 1, 2022
1 parent fb42cc6 commit f6980f9
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ public PointObjectLayer(ImageryInfo info) {

@Override
public void finishedLoading(MVTTile tile) {
// First, don't load empty tiles
if (tile.getData().getAllPrimitives().size() == 6
&& tile.getData().getAllPrimitives().stream().anyMatch(i -> "water".equals(i.getLayer()))) {
return;
}
// This is required for the mapcss to work properly
tile.getData().getAllPrimitives().forEach(primitive -> primitive.put("layer", primitive.getLayer()));
tile.getData().getAllPrimitives().stream().filter(primitive -> primitive.getId() != 0)
Expand Down

0 comments on commit f6980f9

Please sign in to comment.