Hi there, I think I’ll need to do some kind of diff or pull request for you on this one, it’s a bit complicated to list out here. I changed the leaflet.js and the showmap.php to wrap their javascript executions, changed leaflet-maps-marker.php to load ‘leafletmapsmarker-googlemaps-loader’ prior to jsapi (for callback), added a callback parameter to jsapi alongside the google api key and forced all scripts to use the defer attribute. The javascript code runs precautionary sanity checks using setInterval to determine when to execute the counterparts (though via debugging it didn’t seem to need that).
One particular downside is I’m using a WP vers 4.5 feature wp_add_inline_script, since it was the quickest solution to get the callback into the correct spot. So that rules out some of the backwards compat for certain peoples. A second downside, is I’m hooking the document.write function, to perform a $(‘body’).append(jsapi_code), then restoring it afterwards. Why is google writing to the document buffer anyway, that’s so year 2000. ??
It works great, but I am unsure on it’s suitability for public consumption. I think you guys may be able determine a more elegant way to handle this, but let me know how best to get the codeset over to you