Fr0sT-Brutal / Delphi_OSMMap

Visual control for Delphi and Lazarus to display OSM map
Mozilla Public License 2.0
65 stars 22 forks source link

Tile not saved #4

Closed array81 closed 3 years ago

array81 commented 3 years ago

I have problem to run demo on Delphi XE2. The demo get error about PNG not valid it would seem te PNG is download but not saved. In TNetworkRequestThread.Execute I think the stream is not transferred, so a black stream is saved. Right?

AlexHausauer commented 3 years ago

У меня тоже была такая проблема, когда некоторые части загружались с ошибкой. Так как в программе нет обработки ошибок на загрузку и сохранение png файла, иногда сервер из-за ошибки подключения в поток помещал не содержимое закачиваемого файла, а текстовую информацию об ошибке на сервере. И тогда программа, открывая такой загруженный файл (по сути файл html), не смогла преобразовать его в png. Что бы избавиться от ошибки нужно удалить все файлы, которые уже были закешированы на диске и повторить попытку с повторной загрузкой карт, убедившись что есть доступ к сети интернет и прокси не блокирует подключение.

Fr0sT-Brutal commented 3 years ago

@array81 yeah probably @AlexHausauer is right (server returned non-PNG response). I'll look into adding error check for received responses

array81 commented 3 years ago

The problem is the agent. OSM does not return tile if the connection does not have agent.

Fr0sT-Brutal commented 3 years ago

@array81, you're right, that was the problem! I'm now currently working on this issue, had to rework almost all netrequest internals. As a side improvement, proxy and auth support are added.

Fr0sT-Brutal commented 3 years ago

Now, with the new v.0.5.0, this issue is fixed