Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author webaware

    (@webaware)

    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

    Thread Starter ridewithjoe

    (@ridewithjoe)

    No… still not working…. doesn’t even seem to try and load…. no box.. nothing. That’s what’s got me stumped.

    Plugin Author webaware

    (@webaware)

    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

    Plugin Author webaware

    (@webaware)

    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.

    Thread Starter ridewithjoe

    (@ridewithjoe)

    Doesn’t work. πŸ™

    Is the syntax of this line correct? $url .= “‘ data-cfasync=’false”;
    The “quotes” seem off but I’m no expert.

    Plugin Author webaware

    (@webaware)

    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.

    Thread Starter ridewithjoe

    (@ridewithjoe)

    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.

    Plugin Author webaware

    (@webaware)

    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

    Thread Starter ridewithjoe

    (@ridewithjoe)

    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.

    Plugin Author webaware

    (@webaware)

    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

    Thread Starter ridewithjoe

    (@ridewithjoe)

    That did the trick. There is certainly a lot more code there now LOL.

    Thanks!

    Plugin Author webaware

    (@webaware)

    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

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Map won't appear’ is closed to new replies.