simplemap
simplemap copied to clipboard
Fix Google Maps api load order + provide an extra callback for devs to hook into
Fixes #294
Fixes the load order for Google Maps api. Since it uses a passed callback in the URL, the callback needs to be added first, hence changing to registerScript to force the order (Craft doesn't seem to have a mechanism to specify assets order except AssetBundles).
Also added an onload event to provide an extra callback with "onload" since the code already provides the callback to add the markers. By adding this callback, we are guaranteed that our extra code executes after the Google Maps API is loaded and that the initial callback is executed.