Move this topic
google maps api 3 appcache
in jQuery Mobile
•
11 years ago
i am building a mobile web app and i use application cache of html5 for offline capabilities. I have a problem with google maps. I cache all the files i need, and i run my app from application cache. But when i try to use google maps api 3 everything goes wrong (keep in mind i have internet connection, i do not want to use google maps offline). I do not know what to include in the manifest file to make the app get the files needed from the internet. What do i have to include in the manifest file so the GET request of google maps api 3 not to fail.
Thank you all for the responses.
Alkis
1
Replies(11)
Re: google maps api 3 appcache
11 years ago
Leave a comment on zSprawl's reply
Re: google maps api 3 appcache
11 years ago
There is no way to use google maps offline from within jQM. Only google maps for Android offer offline caching if you use a certain map frequently.
Re: Re: google maps api 3 appcache
11 years ago
I don't want to cache the tiles. I use the manifest because i want the other services to work offline, not the maps service. But because i use appcache, it caches the files even when online. What i want is to "tell" the manifest to seak the files needed for the maps from the internet.
Leave a comment on bardu's reply
Re: google maps api 3 appcache
11 years ago
Sorry to bother you guys. I found it. Thank you for your time and effort. I had to include these lines in the NETWORK section of the manifest
http://maps.gstatic.com/
http://maps.google.com/
http://maps.googleapis.com/
http://mt0.googleapis.com/
http://mt1.googleapis.com/
http://mt2.googleapis.com/
http://mt3.googleapis.com/
http://khm0.googleapis.com/
http://khm1.googleapis.com/
http://cbk0.googleapis.com/
http://cbk1.googleapis.com/
http://www.google-analytics.com/
http://gg.google.com/
Re: Re: google maps api 3 appcache
11 years ago
It not works for me. How it works for you?
if we add all these URLs to NETWORK section it means that all these files will never be cached and in offline modean error will occur:
http://en.wikipedia.org/wiki/Cache_manifest_in_HTML5
"As a result an error will occur when an attempt is made offline to load the resource"
actually, this situation I got.
Could you please describe mode detailed your solution?
if we add all these URLs to NETWORK section it means that all these files will never be cached and in offline modean error will occur:
http://en.wikipedia.org/wiki/Cache_manifest_in_HTML5
"As a result an error will occur when an attempt is made offline to load the resource"
actually, this situation I got.
Could you please describe mode detailed your solution?
Leave a comment on alkiviadis's reply
Re: google maps api 3 appcache
11 years ago
As i described in my initial post, and in a response post, i did not want to cache the maps.
That's why I include those url's in the network section.
With google maps that's illegal. You can't cache their tiles.
Leave a comment on alkiviadis's reply
Re: google maps api 3 appcache
11 years ago
Hello, Alkis.
I see people can't understand your question :))
Somehow, I have question to you. Perhaps today you already have answer on it.
Do you know how to allow browser to update html-page (with manifest) every time you refresh page
but in same time any other resources on page (like pictures & JS ) should be pulled from AppCache ?
This question little bit like yours, but from another end :))
Please, give me your answer, if you have.
I see people can't understand your question :))
Somehow, I have question to you. Perhaps today you already have answer on it.
Do you know how to allow browser to update html-page (with manifest) every time you refresh page
but in same time any other resources on page (like pictures & JS ) should be pulled from AppCache ?
This question little bit like yours, but from another end :))
Please, give me your answer, if you have.
Leave a comment on Mr.Torrent's reply
Re: google maps api 3 appcache
11 years ago
Hello Mr. Torrent.
Well sadly no, i don't have an answer to that (i'm really just a noob :) ).
I think about it like this. You cache your images and js files.
But when you make a request to the server to send you again the html page then
all the img and script tags will load the content from the server (i think that's the case, i haven't tested it).
What you can do, is cache the html page as well and just use ajax for the parts you want to refresh.
But probably you have already thought about that. Please, let me know what you decided to do when you've finished your project.
Leave a comment on alkiviadis's reply
Re: google maps api 3 appcache
11 years ago
Hello, Alkis.
Yes, I
thought about
My essential target of AppCache usage is use it like perfect way to decrease
quantity of requests from client to server. My server is very busy man :)) . AppCache
really reduces huge amount of requests to one request. This one request is “Is Manifest
updated?”. So it works better than usual browser cache.
But AppCache
sucks in all files like a swamp and don’t read them again from server until Manifest
changes.
So I have made
“cool” manifest :)) . This is manifest file with php-script inside which
generates inner data when client invokes manifest.
It has three
commands for its management: “normal”, “clear” and “change version”.
Normal – generates normal manifest file with my list in “CACHE” section.
Clear – generates manifest file with clean list in “CACHE” section.
Change
version – generates clean or normal manifest file with changed comment line “# Version: #####”.
I think you
know that when you change even comments in Manifest your browser understand it
like a challenge to re-read Manifest and compare AppCache with files on server.
At this time your client gains all needed updates.
So you can make
JS (
So today I
don’t have good solution too :((
Leave a comment on Mr.Torrent's reply
Re: google maps api 3 appcache
11 years ago
At this document I have found a lot of answers on my questions:
http://appcachefacts.info/
The main is "FACT: Regardless of whether you include the address of the current page in the manifest, it will be cached. "
http://appcachefacts.info/
The main is "FACT: Regardless of whether you include the address of the current page in the manifest, it will be cached. "
So we need to poke browser developers to give us control to choose when I want cache current page and when I don't want cache current page but want cache all pictures, js-files, css-files, etc. on this page. :))
Leave a comment on Mr.Torrent's reply
Change topic type
Link this topic
Provide the permalink of a topic that is related to this topic
Reply to alkiviadis's question