Tech, Oracle, user experience, coffee, design standards, and shameless ranting

ESRI offline cached map files on an Android tablet

Warning: mysql_get_server_info(): Access denied for user ''@'localhost' (using password: NO) in /home/blucel/public_html/wp-content/plugins/xml-google-maps/xmlgooglemaps_dbfunctions.php on line 10

Warning: mysql_get_server_info(): A link to the server could not be established in /home/blucel/public_html/wp-content/plugins/xml-google-maps/xmlgooglemaps_dbfunctions.php on line 10

Well, this is a challenge.


  • To have an offline app on a tablet that contains a full set of tiles for offline viewing.
  • As we are an ESRI house, we must use ESRI technology
  • Must consume shapes files, show aerial layers and OS layers
  • Must show different zoom levels

I’m still working all this out and wasnt at all stuck on the ESRI javascript API as I didnt think I could store tiles offline.

I’ve tried

Cloudmade Leaflet

Open Layers

ESRI javascript API

Maybe some more APIS, im not sure


I though about using MBTILES and writing some code to fetch the base64 data based on what the map API needed, but this was very tricky to deploy to the devices. I also wanted to be able to update the data regularly.

Probably I’m warbling a bit here, but I’ve been at this for the last few days, and have been thinking about it for about three months now.

Anyway – this is what I think I have working:

Download map tiles to .png from an ARCGIS cache server

Store these on a folder on the android device

(or bundle them with Phonegap in a subfolder of assets/WWW)

Grab the json from the ESRI mapserver endpoint

i.e. http://myESRIserver/MapServer?f=pjson

Put this is a text file on the local disk

Point the var tiledMapServiceLayer to the text file

Extend ArcGISTilesMapServiceLayer to fetch the .png from the local folder based on the x y z parameters passed to this method rather than the server.

Phew. Does that make sense? I’ll try firm up the instructions when I get free of it.

For now, I have a semi-working;┬áI haven’t copied all the tiles over to the local folder yet, for now im using a static jpg file, so the entire Scotland area is built up of a 250px * 250px view of central scotland!

More soon.

has anyone else done this? i couldn’t find much online. I think its a really handy thing to have offline ESRI based maps.

Once I’ve done it in ESRI, i intent to port it to openlayers and leaflet.

I’m an Oracle specialist ┬ánormally, but its nice to get my teeth into some mapping. i love the visual aspect of development.

Isn’t GIS wonderful?



You can follow any responses to this entry through the RSS 2.0 feed.

Switch to our mobile site