Skip to content

Commit

Permalink
#369 monitor vector tiles poc - avoid negative tile x and y
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarc committed Dec 15, 2023
1 parent 1e6921c commit 0f49a90
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,16 @@ class LineSegmentTileCalculatorImpl(tileCalculator: TileCalculator) extends Line
xDelta: Int,
yDelta: Int
): Unit = {
val adjecentTile = tileCalculator.tileXY(tile.z, tile.x + xDelta, tile.y + yDelta)
if (!foundTiles.map(_.name).contains(adjecentTile.name)) {
if (lineSegments.exists(_.intersection(side) != null)) {
tileQueue += adjecentTile
foundTiles += adjecentTile
()
val x = tile.x + xDelta
val y = tile.y + yDelta
if (x >= 0 && y >= 0) {
val adjecentTile = tileCalculator.tileXY(tile.z, x, y)
if (!foundTiles.map(_.name).contains(adjecentTile.name)) {
if (lineSegments.exists(_.intersection(side) != null)) {
tileQueue += adjecentTile
foundTiles += adjecentTile
()
}
}
}
}
Expand Down

0 comments on commit 0f49a90

Please sign in to comment.