Skip to content
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

White tiles... #31

Open
markbaumgarten opened this issue Mar 19, 2022 · 17 comments
Open

White tiles... #31

markbaumgarten opened this issue Mar 19, 2022 · 17 comments
Labels
bug Something isn't working

Comments

@markbaumgarten
Copy link

First of all: Thanks for a great project!

Second:

Please see screenshot below. Occasionally my custom handler wants to load tiles that are invalid.

I think this might be the reason for the white region seen. Can anyone point me in the right direction for a fix?

avoiding_white_tiles

This is my Provider code(copied from this project).

export class OurOpenStreetMapsProvider extends GEOTHREE.MapProvider
{
               constructor(address) {super();}
               fetchTile(zoom, x, y)
               {
                   return new Promise((resolve, reject) =>
                   {
                       var image = document.createElement("img");
                       image.onload = function(){resolve(image);};
                       image.onerror = function(){reject();};
                       image.crossOrigin = "anonymous";
                       //image.src = "https://tile.openstreetmap.org/10/546/321.png";
                       //image.src = "https://tile.openstreetmap.org/" + zoom + "/" + x + "/" + y + ".png";
                       image.src = mapserver + zoom + "/" + x + "/" + y + ".png";
                   });
               }
}

This is one of the wrong tile urls:

https://tile.openstreetmap.org/20/560839/328106.png

@JannikGM
Copy link

According to https://stackoverflow.com/a/34003577 that server only provides until zoom level 19.

You can also see this when looking at URLs:

@markbaumgarten
Copy link
Author

Hi Jannik - thanks for your reply.

This explains the invalid requests. I have now changed my mapprovider settings:

-            mapprovider.maxZoom = 20;
+            mapprovider.maxZoom = 19;

...and it no longer calls the invalid urls on the map server....however I still get the white squares on my map :-( - does anyone know what I can do to fix that?

@markbaumgarten
Copy link
Author

Here is an example video of the problem:

white.mp4

@tentone
Copy link
Owner

tentone commented Mar 21, 2022

Hello

Thanks a lot, indeed the problem is related with the zoom levels provided by the openstreetmaps API.

The provider object can be changed to adress this issue by setting the default max level to 19.

The white tiles seem to be related either with a texture upload problem or API response missing. Do you have any warning on the console for these?

Thanks a lot

@markbaumgarten
Copy link
Author

No warnings in the console other than these from the initial load of the page - but I believe these are irrelevant:

DevTools failed to load source map: Could not load content for http://localhost:8888/static/vis-timeline-graph2d.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://localhost:8888/static/geo-three/build/geo-three.module.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://localhost:8888/static/three.js/3d/jsm/libs/dat.gui.module.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

No additional console output at all when the white tiles appear during my speedy zoom-in/zoom-out.

@markbaumgarten
Copy link
Author

Here is a screenshot from the live demo where i have selected openstreetmap twice in the top right corner.
white_tiles

@markbaumgarten markbaumgarten changed the title Openstreetmap: You requested an invalid tile. White tiles... Mar 21, 2022
@markbaumgarten
Copy link
Author

I have decided to change the title of the issue, since this issue is present regardless of the mapprovider and the zoom levels.

Since I am at a loss trying to figure out why, here's another screenshot using the default bing maps.

Hoping to see a fix (event though I think the current state of this project is awesome).

white_with_bing

@ligaofeng0901
Copy link

same problem, and there is no error in network requests

@tentone
Copy link
Owner

tentone commented Mar 30, 2022

So after some diging i think that i have a solution for this issue.

This is related with texture loading, aparently we have a race condition in the texture usage before load.

I will publish a new package soon on npm so that you can check if it fixes the issue on you side as well.

Thanks a lot!

@tentone tentone added the bug Something isn't working label Mar 30, 2022
@tentone
Copy link
Owner

tentone commented Apr 3, 2022

@markbaumgarten A new version has been published on npm. (0.0.17)

Please test with the new version to check if the bug war fixed!

Thanks a lot once again!

@markbaumgarten
Copy link
Author

Nice to see that you are looking into things. It is very much appreciated!

I have replaced the build with the latest version and it seems to still be an issue. Also visible in the live demo version...:

white_tiles

@laraduarte
Copy link

same problem on my end. Any updates on this?

@markbaumgarten
Copy link
Author

markbaumgarten commented Nov 7, 2022 via email

@laraduarte
Copy link

laraduarte commented Nov 8, 2022

@markbaumgarten on that case the issue could be the amount of requests we're doing. Most servers/services limit the amount of requests we can do per second. I will investigate this a little bit more. Maybe adjusting the zoom speed will make the issue go away. Let's see :)

@laraduarte
Copy link

laraduarte commented Nov 10, 2022

So I did an extreme test :D a debug layer on top of Bing layer and it confirmed my suspicion, the bing layer is not requesting the white tiles. I should have log 'loadTexture 13 4095 4093' twice on the console but only the OffscreenCanvas (debug layer) is there!

Any ideas @tentone?

Thanks a lot!

image
image
image
image

@laraduarte
Copy link

new discovery @tentone, powerDistance instead of scaleDistance fixes the issue! The new issue is the size of the texts on the map :D, they are a little bit smaller now! What can I do to have the text a little bit bigger?

image
image
image

Thanks a lot

@tentone
Copy link
Owner

tentone commented Nov 10, 2022

So I did an extreme test :D a debug layer on top of Bing layer and it confirmed my suspicion, the bing layer is not requesting the white tiles.

I can confirm i have done some testing before and this problem is not related with the tile requests they seem to be working correctly.

I believe the problem is related to texture upload. But still need to perform additional testing to be sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants