mirror of https://github.com/tidwall/tile38.git
parent
d2da9ca6ee
commit
08afe004ae
|
@ -92,3 +92,11 @@ func TestLatLonClippingFuzz(t *testing.T) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestIssue302(t *testing.T) {
|
||||
// Requesting tile with zoom level > 63 crashes the server #302
|
||||
for z := uint64(0); z < 256; z++ {
|
||||
tileX, tileY := PixelXYToTileXY(LatLongToPixelXY(33, -115, z))
|
||||
TileXYToBounds(tileX, tileY, z)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,10 +33,10 @@ func TileXYToBounds(tileX, tileY int64, levelOfDetail uint64) (minLat, minLon, m
|
|||
maxLat, minLon = PixelXYToLatLong(pixelX, pixelY, levelOfDetail)
|
||||
pixelX, pixelY = TileXYToPixelXY(tileX+1, tileY+1)
|
||||
minLat, maxLon = PixelXYToLatLong(pixelX, pixelY, levelOfDetail)
|
||||
if tileX%size == 0 {
|
||||
if size == 0 || tileX%size == 0 {
|
||||
minLon = MinLongitude
|
||||
}
|
||||
if tileX%size == size-1 {
|
||||
if size == 0 || tileX%size == size-1 {
|
||||
maxLon = MaxLongitude
|
||||
}
|
||||
if tileY <= 0 {
|
||||
|
|
Loading…
Reference in New Issue