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!