From f6980f901877eff474e4798a1e8d75c40f6156db Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Fri, 1 Jul 2022 06:13:33 -0600 Subject: [PATCH] PointObjectLayer: Don't add empty tiles Signed-off-by: Taylor Smock --- .../josm/plugins/mapillary/gui/layer/PointObjectLayer.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/PointObjectLayer.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/PointObjectLayer.java index 1a20c1df7..9e47036b8 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/PointObjectLayer.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/PointObjectLayer.java @@ -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)