-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-existent zoom on an overlay. #33
Comments
Hi, I'm not sure I follow, even though I get a sense of what you're trying to achieve. Perhaps you could fork the project, edit one of the demos and showcase the problem you're having? It would be much easier for me to provide advice. P.S: I'm french, yes, but we can communicate in English (so that other people understand this conversation). |
I'm trying to render via a sqlite tile database. Except I didn't put all the zooms. I would like to have no white area when a zoom is not available. I have the problem as soon as I move the map. |
Taking your example, if we zoom in from level 0 to 4 (while level 3 is non existent), we should be able to see the level 2 before loading the level 4. Is that what you mean? |
Alright, it's clear now. FWIW, a proper way to handle missing levels (or "level gaps") is to subsample tiles from the next reachable level. The reason is: imagine you have levels 1 to 10 and levels 2 to 9 are missing. When zooming in from level 1, and when tiles from level 2 should be loaded, suddenly loading tiles from level 10 would result in loading way too many tiles (hundreds, or thousands). The result would be an out of memory error (OOM). |
Or maybe a mapView configuration where we give the available zoom levels? |
MapView wasn't designed for that. It's built with the assumption that there are no missing levels. |
Actually, as I'm thinking about it, I realized that what I suggested about tolerating one missing level would only be a workaround for zooming out. It wouldn't work when panning, as only tiles from the current level would be requested. |
ok, I use OSMAnd and it handles this lack concern well, I'll look at how they did it. Because for the moment I can't modify the lib to have a good return. |
If you have any idea how to get the tile from the level out I'm interested, I've done some things that don't work now and I don't have much idea. |
Imagine you have missing level n, but you have level n + 1. Each tile from level n is made of 4 tiles of level n + 1 which form a square. If tiles are 256 px wide, the square is 512 px wide. Then, the square is subsampled to make a tile of 256 px wide. Alternatively, if you start from a huge image, you can tile it and generate all intermediary levels using libvips. See this tutorial. |
I understood the principle but when I ask for zoom 3 col 5 row 4 I can't find the values for zoom 2 of col and row |
I don't see how getting the lower zoom will make a memory error since the image is smaller. |
A tile from level n, with row i and col j, noted Tile(n, i, j) corresponds to 4 tiles at level n + 1:
MapView does not look for lower levels, be cause it wasn't designed for missing levels. |
In the zoom direction I understood well but from zoom 3 to know the zoom 2 tile I can not. |
Well the formula is all there. You have to treat tiles from level n+1 four by four, starting from the upper left corner, and generate tiles for the lower level. |
We don't understand each other, I try to do this. |
You got it. Start from the upper left corner of level n+1: Tile(n, 0, 0):
Tile(n, 0, 1):
And so on. |
Je passe en francais, nous nous sommes pas compris. je ne veux pas trouver les tuiles du zoom plus precis mais du zoom inférieur. |
Ce n'est malheureusement pas possible avec MapView, à moins de modifier la lib en profondeur. Le plus simple, quand on a la main sur les données, est de générer les niveaux manquants avec les formules au dessus. |
Thanks a lot, I'll see if I can do something. If not, I'll see if there are other libs. |
Hi, I try to display a background with an overlay, if the 2 have the same zoom availability I have no problem but I would like that if one of the 2 maps does not have a zoom that it continues to be displayed but with the old zoom.
The problem is that I do the overlay in getTileStream, maybe it's a mistake?
Can we find the previous zoom and row and col value in the getTileStream method?
I'm using a tile database and I don't have all the zoom so you can understand my request better.
Thank you in advance for your response
In french
Bonjour, j’essai d’afficher un fond avec une sur-couche. Si les 2 ont la même disponibilité de zoom je n’ai pas de souci mais j’aimerais que si l’une des 2 cartes n’a pas un zoom qu’elle continue a s’afficher mais avec l’ancien zoom.
Le problème est peut etre lié au faite que je fais la sur couche dans getTileStream c’est peut être une erreur ?
Peut on trouver le zoom précédent et la valeur row et col dans la méthode getTileStream ?
J'utilise une base de donnée de tuile et je n'ai pas tout le zoom pour que tu comprennes mieux ma demande.
Merci d'avance de votre réponse
The text was updated successfully, but these errors were encountered: