Topic: Question about tile sources

Hi
I'm using Online maps with the following option :

source : Resources And Online.

I added the option for the user to download a set of tile in resources (based on top left and bottom right lat/lng) in case there would be no internet access for a futur use. It's working great.

However, if i change the provider ( and i'm having an internet access), the tiles that i downloaded (with a provider A) will always appear and won't be replaced by tiles from the internet (with provider B).

See this example :
- tiles from arcGIS where downloaded in resources
- provider has been switched to nokia - night mode
- the ArcGIS tiles won't disapear

Is there a way to prevent the tiles from the resource to appear if the provider is not the same ?

https://i.imgur.com/PJwwCCU.jpg

Thanks

Thibault

Re: Question about tile sources

Hello.

"I added the option for the user to download a set of tile in resources ..."
Sorry, but I do not understand this phrase.
As far as I know, you can create / modify resources only in the Unity Editor.
After publication, the resources are not changeable.

So there may be two things:
1. User download tiles not into Resources.
2. You have some kind of your own meaning of the word “user” that works in Unity Editor.
What is your case?

Kind Regards,
Infinity Code Team.

Do not know the best way to thank the developer? Rate the asset in Asset Store!

Re: Question about tile sources

I'm using the script provided here to download tiles:

http://forum.infinity-code.com/viewtopic.php?id=1052

So you are right, it's not downloaded in the resources folder but in a folder named "Tiles".

My definition of "user" is the guy holding the tablet: the screenshot i provided was not from unity editor but from my app.

So tiles where downloaded on the tablet using the script, (with map provider set to arcGIS) then provider was change to something else (nokia night mode).

I guess i need to find where in the code the decision is made to use the pre-downloaded tile vs new tiles to download and add a check about the provider

Re: Question about tile sources

Modify the method TileDownloader.GetTilePath, and add the maptype ID into the path.

private string GetTilePath(int zoom, int x, int y)
{
    StringBuilder builder = new StringBuilder(folder);
    builder.Append(OnlineMaps.instance.activeType.fullID).Append("/"); // <<-- HERE
    builder.Append(zoom).Append("/");
    builder.Append(x).Append("/");
    builder.Append(y).Append(".png");

    return builder.ToString();
}
Kind Regards,
Infinity Code Team.

Do not know the best way to thank the developer? Rate the asset in Asset Store!

5 (edited by digitalmkt 2020-06-27 22:12:47)

Re: Question about tile sources

I'm having the same problem here. The tiles downloaded by the first time doesn't change when I switch to the Mapbox customized map only.
The tiles were downloaded using the TileDownloader.cs on OpenStreetMap and Bing providers.

All instance of the tiles was deleted from the project folders and local Persistentpath and it still appears as a tile when I run in editor and device...I also changed to Online and the tiles downloaded still.

PunBB bbcode test

The image shows the map with both 2 types of tiles one from Bing and the Mapbox.

I'm also using Unity Addressables to manage the remote download of the tiles.

There's any other cache location OnlineMaps uses to load these tiles from there?

Thank you.

Re: Question about tile sources

Try clearing the file cache (Online Maps Cache / File Cache / Clear).

Kind Regards,
Infinity Code Team.

Do not know the best way to thank the developer? Rate the asset in Asset Store!

Re: Question about tile sources

yes, I did it before many times with no effect, including directly cleaning the persistent path folder. The solution for me was disabling Memory Cache and File Cache as shown in the image below. I check it again and the old tiles disappear from the cache. Thank you.

PunBB bbcode test

Re: Question about tile sources

You mentioned that you are using TileDownloader, so check that this script most likely has downloaded tiles in Application.persistentDataPath + "/Tiles/".
https://docs.unity3d.com/ScriptReferenc … aPath.html

Kind Regards,
Infinity Code Team.

Do not know the best way to thank the developer? Rate the asset in Asset Store!