1 (edited by Sinthien 2019-03-08 14:06:29)

Topic: Calculate, Load and Save Tiles of specified area for offline use

Hello Team,
first thank you for the awesome plugin !
For my program i need to download a specific set of tiles (of a specific area which the user can choose).
For example: im at home and need the map of another city where i have no internet access.
So far i need to scroll through the entire city in order to download and store the tiles.

Is there a way the user can set Point A (Lat|Lon), Point B (Lat|Lon) and preload all Tiles within this area and given zoom-ranges ?
And as bonus get a calculation of diskusage and amount of tiles ? (Edit: your online tile counter does this calculation already. but how can i make use of this in my application?)

Re: Calculate, Load and Save Tiles of specified area for offline use

Hello.

Example is attached.

Post's attachments

Attachment icon TileDownloader.cs 9.03 kb, 363 downloads since 2019-03-09 

Kind Regards,
Infinity Code Team.

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

Re: Calculate, Load and Save Tiles of specified area for offline use

Whoah yikes Thx a lot ! Works like a charm and expected ! big_smile big_smile

Re: Calculate, Load and Save Tiles of specified area for offline use

Could you please direct me to the way on how I can use tiledownloader.cs to pre-populate cache?

Re: Calculate, Load and Save Tiles of specified area for offline use

You specify the coordinates of the area boundaries and zoom range and click Download button on GUI.
Or just use this script as an example of how to implement a download area, and use tiles from the downloaded data.

Kind Regards,
Infinity Code Team.

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

Re: Calculate, Load and Save Tiles of specified area for offline use

Hi Alex, the TileDownloader script unfortunately doesn't seem to work when provider is set to "Custom". I'm using a custom map style, that's why I need the custom provider.

map.activeType.GetURL(tile) won't return any URL with this setting. Is there any workaround for that or does it simply not work for custom map styles?

Thanks in advance!

Re: Calculate, Load and Save Tiles of specified area for offline use

Hi.
Try to replace (line 299):

string tileURL = map.activeType.GetURL(tile);

to:

string tileURL = tile.url;
Kind Regards,
Infinity Code Team.

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

Re: Calculate, Load and Save Tiles of specified area for offline use

Works perfectly fine, thank you so much!