G’day Joe,
That map loads fine for me in a test site; probably it was loading a cached copy from Google’s KML cache and that was broken. The cache has cleared now.
To ensure that the cache does clear and reload your KML file periodically (useful for tracking your movements), you need to change the URL slightly each time Google loads it. Here’s a simple plugin that will do that on every KML file, once per hour (so that Google still caches your KML for an hour).
https://gist.github.com/webaware/8946050
NB: this solution won’t work with page caching plugins, e.g. WP Super Cache / W3 Total Cache. The next version of WP Flexible Map will have a better solution that will work with caching plugins.
cheers,
Ross
No… still not working…. doesn’t even seem to try and load…. no box.. nothing. That’s what’s got me stumped.
I just noticed that you have CloudFlare’s Rockscript enabled. This is breaking the map plugin script because it ASSumes that any script it finds on a page can be loaded async. Install / activate this plugin to stop it breaking your site:
https://gist.github.com/webaware/8949605
cheers,
Ross
NB: I just updated the gist (to version 2) so that it also marks the Google Maps API to tell Rocketscript to bugger off. Please use the latest version in gist.
Doesn’t work. π
Is the syntax of this line correct? $url .= “‘ data-cfasync=’false”;
The “quotes” seem off but I’m no expert.
I just looked at the page source, that plugin doesn’t seem to be having any effect — the scripts are still being mangled by Rocketscript. Is the page cached? If so, can you clear the cache and try again please?
And yes, the quotes are “off”, deliberately — it’s a dirty hack to add an attribute to a script tag by altering the URL, see this answer for an explanation.
Well I screwed something else up and had to restore the site. After that, it appears to be working and I’m not using the plugin and nothing has changed. Go figure…..
This stuff makes me crazy sometimes.
Still broken for me, still using Rocketscript. Maybe I’m getting a cached copy that you’re not getting.
I’ll have another look at the Rocketscript problem on the weekend, am pushing some deadlines right now.
cheers,
Ross
It’s broken for me now again as well. Must be the caching of Cloudflare delaying things. I put your norocket plug-in back on. No change.
I’ll wait to hear back from you. For now I may be able to turn off Cloudflare.
G’day Joe,
Finally had a chance to try this code on a site behind CloudFlare with Rocketscript turned on. Please try this updated version of Flxmap No Rocketscript:
https://gist.github.com/webaware/8949605
It turns out that I needed to approach the fix quite differently, but works well for me on this test page.
cheers,
Ross
That did the trick. There is certainly a lot more code there now LOL.
Thanks!
Yeah, the main problem was that Rocketscript ignores the special “data-cfasync” attribute they tell you to use, if you have that after the src attribute. And WordPress doesn’t let you insert an attribute before the src attribute, so I had to jump some hoops!
Glad to see it working finally π
cheers,
Ross