Topic: OnlineMapsTile.tiles doesn't contain tiles for all zoom levels

Currently I'm using Maptiler tiles just stored in the Resources folder and looping over each tile in OnlineMapTile.tiles but I noticed that it only contains a limited amount of zoom levels. In my application I have zoom levels that range from 14-20 and the default upon starting the application is 16, but then I noticed when debugging that OnlineMapTile.tiles only is storing 12-16 until zooming in further.

Is there a way to make sure OnlineMapTile.tiles has all zoom levels 14-20 without zooming in so that all zoom levels will be replaced with with the Maptiler overlay.

Example of what some of the code looks like:

foreach(OnlineMapsTile nextTile in OnlineMapsTile.tiles){   
    nextTile.overlayBackTexture = Resources.Load<Texture2D>(string.Format("OnlineMapsTiles/" + floorNum + "/{0}/{1}/{2}",
    nextTile.zoom, nextTile.x, nextTile.y));
}

Any help would be much appreciated. It may be that I'm just going about this the wrong way.

Re: OnlineMapsTile.tiles doesn't contain tiles for all zoom levels

Hello.

Online Maps stores only the tiles required for the current map view + the tiles required for smooth movement and zooming.
There is no point in keeping all tiles loaded, because it will use too much memory.
Instead, Online Maps load tiles when they are needed, and unloads when they are no longer needed.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: OnlineMapsTile.tiles doesn't contain tiles for all zoom levels

Thanks for the response. I assumed this was probably the reason. So if there is no way around that I am currently trying to update the overlay each time it is zoomed to a zoom level for the first time so that OnlineMapsTile.tiles will contain that zoom level. However, the issue I am having now is that for example, I zoom from level 16 to 17 and call the code above to update the overlay but it still only has 16 stored until I change the zoom level again either to 16 or 18. Any idea why or how I could fix this so that it updates right away and doesn't require a second zoom change?

Re: OnlineMapsTile.tiles doesn't contain tiles for all zoom levels

Use OnlineMapsTileManager.OnTileLoaded to load your overlay for the tile immediately after the tile is loaded.
And you will not need to go through the entire list of tiles.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: OnlineMapsTile.tiles doesn't contain tiles for all zoom levels

This worked great, thank you.