How could one serve maps (tiles in wherever format possible) within a Android device to be consumed by an offline webmapping app also accessed within the device's browser?
-
Isn't the primary factor in this situation cache size, i.e. how much you can store offline? Is it large enough to even be worthwhile?– blah238Commented Jan 15, 2012 at 0:06
-
1Have you seen this post? gis.stackexchange.com/questions/18325/…– MathiasWestinCommented Jan 15, 2012 at 14:14
-
@blah238 It is one of the issues, for sure. But I'm thinking to limit the amount of map data available for offline usage by providing some facilities for tile download.– Pedro MendesCommented Jan 15, 2012 at 23:48
-
@MathiasWestin I did. It's really a very innovative approach, but that 5MB storage limit per origin it's really a deal breaker in a sense of keeping all the tiles needed in the localStorage. The live sample of "Tiles in Local Storage" shows exactly that problem because after ajust a changing in the zoom level the browser starts throwing exception with the message "QUOTA_EXCEEDED_ERR: DOM Exception 22"– Pedro MendesCommented Jan 16, 2012 at 0:21
2 Answers
There are a few options using TileMill/Mapbox/MBTiles... Not html5 though. You may want to explore other options for android than html5!!
MBTilesDroidSplitter : https://github.com/djcoin/MBTilesDroidSpitter
Locus : http://www.locusmap.eu/
-
I guess I was hoping that there was some way of setting up a local tile server in way that that HTML5 app could consume geojson tiles, mbtiles, or even other format in some fashionable way. Commented Jan 15, 2012 at 23:55
-
I am about to embark on a dark (first time mobile) path using one of the above 3 packages. Wish me luck! I don't see html5 for mapping applications growing in the android community(yet). Commented Jan 16, 2012 at 8:05
-
2MBTilesDroidSplitter seems like a good catch. I'm hoping we don't have to follow that path (making a native app), though... It will shorten too much our possibilities. Commented Jan 16, 2012 at 11:20
Your webmapping offline code (HTML5 + JS) will be located in the Assets
folder.
You can put your tiles (XYZ or TMS) in a folder hierarchy inside Assets
, too, and access your tiles via relative paths.
You really don't need a web server, the same way you don't need it to import a JS file into your HTML5 page.