Reputation: 916
We are developing a HTML5 application which has a Google map to change the location of search. Now this app has an offline version too. Is there any way i can cache the Google map & when the application is offline, it will show the offline version?
And how could we enable the user to change the location again?
Upvotes: 2
Views: 2964
Reputation: 2645
There is not currently any caching mechanism in place for google maps, in fact the map tiles that are downloaded explicitly have the nocache header specified (interestingly, there is work being done on caching for the Android version of maps, but it is still experimental). In order to leverage maps offline, you would likely need to roll your own caching scheme.
With the explosion of mobile devices, and the probability of being disconnected at some point while using a mobile device, it wouldn't surprise me if Google did add offline browsing capability to maps at some point in the future though (maybe v4?).
UPDATE:
There is a feature request in the public issue tracker:
https://code.google.com/p/gmaps-api-issues/issues/detail?id=8914
Please star this feature request to express your interest and receive further updates from Google.
Upvotes: 2
Reputation: 105
I made an HTML5 application with a cached map, however it was not a Google Map. I used the tiledownloader from http://search.cpan.org/~rotkraut/Geo-OSM-Tiles-0.02/downloadosmtiles.pl and downloaded the areas I needed using Mapquest's Open tile server because they don't have a hit limit. I then iterated over all of the tiles with a script and added them to the cache.manifest file. Then I just use Leaflet by Cloudmade to map the tiles.
Upvotes: 1