Исправление. В режиме "Работа", при увеличении масштаба за пределы доступной на сервере детализации, происходит непрерывный запрос плиток карты с сервера
This commit is contained in:
@@ -557,19 +557,12 @@ func get_tile(x: int, y: int, z: int, create: bool = true) -> Tile:
|
||||
|
||||
var queue_size: = _queue.size()
|
||||
if create and (not $canvas/player.is_playing()):
|
||||
if z > max_zoom_level_server:
|
||||
z = max_zoom_level_server
|
||||
n = pow(2, z) - 1
|
||||
x = clamp(x, 0, n)
|
||||
y = clamp(y, 0, n)
|
||||
idx = xyz_to_idx(x, y, z)
|
||||
if _queue.has(idx):
|
||||
tile = _queue[idx]
|
||||
if not tile:
|
||||
tile = Tile.new(idx, x, y, z)
|
||||
tile.url = base_url.replace('{x}', str(x)).replace('{y}', str(y)).replace('{z}', str(z))
|
||||
tile.t = now
|
||||
_queue[idx] = tile
|
||||
if z <= max_zoom_level_server:
|
||||
_queue[idx] = tile
|
||||
|
||||
if queue_size == 0 and _queue.size():
|
||||
emit_signal('load_started')
|
||||
|
||||
@@ -29,7 +29,7 @@ size = Vector2(400, 400)
|
||||
[node name="tilemap" type="CanvasGroup" groups=["gui_items"]]
|
||||
script = ExtResource("1_l64tp")
|
||||
base_url = "http://192.168.11.105:8001/osm_tiles/{z}/{x}/{y}.png"
|
||||
max_zoom_level = 10
|
||||
max_zoom_level = 15
|
||||
max_zoom_level_server = 10
|
||||
az = 2.0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user