I am running a frontend map with a KML file that is contantly being updated throughout the day. unfortunately, the KML file is being updated, but the map is showing the first version of the KML file.
is there a cache system that might be causing this? or is there something you can do to help me?
you can see the map here: http://www.keyscience.org/cs-lab/map/
thanks for any support and for a great plugin!
Yeah this is absolutely possible your facing cache issue. I am getting this map right now. Is it right or getting wrong kml.
no, that is not the correct map. there should be a red dot in the water to the left of the island.
can you help me deactivate any caching with the KML layers? or maybe set the cache to dump every 1 or 2 hours?
thanks for any advice or help you can give me!
I checked your website source and found you are also using custom kml codes in your site. I think thats why you are facing this issue. Whenever you want to change kml layer you need to change it on kml layers located under layer settings.
the concept of this section of the website is that users can upload photos on the "Record" page, after which we create a new KML file (maps.kml) with their upload and resave it (maps.kml). then, your plugin renders the KML file (maps.kml) on the "Map" page.
our problem is that after a user uploads, we must change the filenames (maps-1.kml) to get the map to render properly.
can you explain what you mean by "custom kml codes"? is it an issue with the KML file?
unfortunately it is still showing the wrong version of the KML file. is there something in the plugin causing the cache? and can it be turned off?
I have been working on this same issue for months, and yes google caches kml files. I think for very long periods of time. I have just found what may be a work around, as I also use in the map a link that has the same file name and the underlying data changes daily.
So the workaround I found was to use network link option.
I created a kml file like this
http://www.spc.noaa.gov/climo/reports/yesterday.kmz -> this is the original layer link
onInterval -> this is the refresh type
300 -> this is interval in seconds minimum is 300 (google)
Name this kml what you like and put it in the map manager klm link mine is like http://mydomain/wp-content/uploads/mynetworklink.kmz
Will see how it goes over the next couple of days to see if my site matches the noa site data.
So this link is to the page that started me on the answer
<?xml version="1.0" encoding="utf-8"?>
Thank you very much for your valuable suggestions, we also tested this issue with both kml/kml at our end and found ,we need to change every time file name then output is change otherwise previous output is displayed everytime.
A way to over come is like you say and change the name each time the page is refreshed or on an interval, as some may need frequent or as I do once a day. Maybe you could add code to do this. Some thing like
[code]var URL = filename+"?dummy="+(new Date()).getTime();[/code]
just a thought
divyang, thanks for testing it out. do you have any suggestions for a workaround?
No, it is not reliable with the use of network refresh. Only changing the name seems to work each time. But that is not practical, editing a map in admin mode every day or whatever period you need updates. Short of spending time to figure out a patch for the code, no. My source for kml file always uses the same name with data changed.
The programers are going to need a method so that any time the page is refreshed or an interval has pasted (short), they takes the kml filename from the settings and add a timestamp to the name before sending the request to google maps for update.
example orginal link read data from somesite . com / my.kml to temp file then change it to my20:21:43.kml and request from google with new temp file
I have discussed with our developer team and they are saying we can solve it. Please provide us your wp login details at email@example.com
At the end of the kml link add ?date();
[code] http://someplace.com/this.kml?date(); [/code]
give it a whirl.
Yeah, that's how we implemented it right now. Please check it and let me know if any issue.
It needs to go in the actual php code that is calling google. I'm not sure where that is, it looks like maps.js layer_options.
So do you have a modified version of the plugin to try?
Previous we were adding version number in maps.js. Now we have added this in php file put-wpgmp.php. Please let me know if any issue. If any issue, please arrange FTP also so it's safe to do changes.