Bug fix: cordova is undefined error
MODIFY
src/android/plugin/google/maps/MyPluginLayout.java
src/android/plugin/google/maps/MyPluginLayout.java
@@ -477,7 +477,7 @@ public class MyPluginLayout extends FrameLayout implements ViewTreeObserver.OnSc
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
if (isSuspended || pluginMaps == null || pluginMaps.size() == 0) {
- webView.loadUrl("javascript:if(cordova){cordova.fireDocumentEvent('plugin_touch', {});}");
+ webView.loadUrl("javascript:if(window.cordova){cordova.fireDocumentEvent('plugin_touch', {});}");
return false;
}
MyPluginLayout.this.stopFlag = true;

MODIFY
src/ios/GoogleMaps/MyPluginLayer.m
src/ios/GoogleMaps/MyPluginLayer.m
@@ -297,7 +297,7 @@ BOOL hasCordovaStatusBar = NO; // YES if the app has cordova-plugin-statusbar
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
if (self.isSuspended || self.pluginScrollView.debugView.mapCtrls == nil || self.pluginScrollView.debugView.mapCtrls.count == 0) {
// Assumes all touches for the browser
- [self execJS:@"javascript:if(cordova){cordova.fireDocumentEvent('plugin_touch', {});}"];
+ [self execJS:@"javascript:if(window.cordova){cordova.fireDocumentEvent('plugin_touch', {});}"];
return [self.webView hitTest:point withEvent:event];
}

Bug fix: cordova is undefined error