Offline map only scale on loading errors? #1957
Replies: 5 comments 1 reply
-
Note this behavior can be easily reproduced with flutter_map example, using the sliding_map example, by changing the code as follows:
With this configuration, if you zoom out to zoom level 0, it finally displays the whole world. However, if you start from Anholt island tile at zoom 12, and move outside covered area, flutter_map does not display the world tile scaled, but displays the grey background. |
Beta Was this translation helpful? Give feedback.
-
Hi there, |
Beta Was this translation helpful? Give feedback.
-
Hi @JaffaKetchup I have experimented another solution, but it is not completely efficient:
I will jump to another possiblity, using tileBuilder ... I'll let you know how it goes ... |
Beta Was this translation helpful? Give feedback.
-
Hi there, I've created a new FileTileProvider as shown below that will return the first available upper level tile if no tile is found at expected level. I believe the issue comes from the display of the tile, where it does not always measure 256x256 depending on the current zoom, but I don't see how to adapt my scale accordingly.
|
Beta Was this translation helpful? Give feedback.
-
FYI, the same issue exists actually for any provider. for instance, let's say you define a layer with OpenStreetMap as provider. OSM is limited to zoom 20.
If you zoom on a specific point to display a tile of zoom 20, and continue zooming, the loaded tile will be expanded. I will raise an issue to track this problem. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm developping an app on Flutter that needs to display offline map.
My need is to display a tile whatever my location and zoom.
To do so, I may have loaded some tiles on my local file system, not covering the whole world with the same zoom level (or instance, I have tiles up to zoom 9 in France, but I only have tile with zoom up to 6 in the US).
If I'm zooming to level 8 in France, and then moving my location to US, I would like the tiles of level 6 to be displayed and scaled, (I have no level 8 tile at this lcoation) rather than having the fallback tile.
If I'm correct in my usage, the current behavior is the following:
PathNotFoundException: Cannot retrieve length of file, path = '/storage/emulated/0/Android/data/com.xxxxx.yyyy/files/Tiles/13/4080/2948.png' (OS Error: No such file or directory, errno = 2)
In order to workaround this behavior, I've implemented my own FileTileProvder, that checks correctly if the requested tile is actually present in my local file system or not.
If it is, I return it.
Otherwise, my idea was to be able to return the upper one (i.e the first available tile with a zoom greater at the same location), and to scale this image to the whole map screen.
Unfortunately, I am unable to achieve this scaling.
Using maxNativeZoom is not a solution as I don't know initially what would be the max zoom of my tiles. And this max zoom may differ from one area to another one. I cannot define a maxNativeZoom efficiently.
Any help would be greatly appreciated,
Thank you,
Christophe.
Beta Was this translation helpful? Give feedback.
All reactions