1. Home
  2. Docs
  3. GO Map – Documentation
  4. Cache
  5. Preload map tiles in the cache folder

Preload map tiles in the cache folder

Many users asked me how to load a portion of map into their products so that GoMap won’t have to do the request anymore (for that area).

I think this is the most effective way to do that and it’s not that difficult, just follow these steps:

 

  • Clear unity editor cache folder using the button on GoMap inspector.
  • Download all the data for the area you need by running GoMap in the editor and moving around (or set a large buffersize and custom coordinates in the locationManager)
  • Go pick the files from the unity editor cache folder of your project and copy them into your project resources folder.GoMap cache folder is situated in the “persistentDataPath/GoCache” folder of your unity editor. PersitentDataPath
  • In your code, somewhere before GoMap starts, you just have to copy these files into the build cache folder that is Application.persistentdatapath/GoChache. for each file in the cache folder you can use the static methods of the FileHandler.cs class that’s included in GoMap:
 public static void Save(string filename, byte[] bytes)

 public static byte[] Load(string filename) 
  • At this point GoMap should read the files from the cache like if it had downloaded them before, job done.
Was this article helpful to you? Yes No

How can we help?