Fix: window.onload does not fire on iOS
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.3.5-beta-20180529-1113" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
+<plugin id="cordova-plugin-googlemaps" version="2.3.5-beta-20180529-1153" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>cordova-plugin-googlemaps</name>
<js-module name="BaseClass" src="www/BaseClass.js">
<runs />

MODIFY
www/googlemaps-cdv-plugin.js
www/googlemaps-cdv-plugin.js
@@ -36,7 +36,18 @@ if (!cordova) {
var execCmd = require("./commandQueueExecutor");
var cordovaGoogleMaps = new (require('./CordovaGoogleMaps'))(execCmd);
- window.addEventListener("load", function() {
+ (new Promise(function(resolve) {
+ var wait = function() {
+ if (document.body) {
+ wait = undefined;
+ resolve();
+ } else {
+ setTimeout(wait, 50);
+ }
+ };
+ wait();
+
+ })).then(function() {
common.nextTick(function() {
// If the developer needs to recalculate the DOM tree graph,
// use `cordova.fireDocumentEvent('plugin_touch')`
@@ -165,8 +176,6 @@ if (!cordova) {
}, true);
});
- }, {
- once: true
});
/*****************************************************************************

Fix: window.onload does not fire on iOS #2293