Add warning if the div is too small.
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.3.0-beta-20180418-0941" 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.0-beta-20180418-1428" 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/CordovaGoogleMaps.js
www/CordovaGoogleMaps.js
@@ -674,7 +674,6 @@ CordovaGoogleMaps.prototype.getPanorama = function(div, streetViewOptions) {
self.MAPS[mapId] = panorama;
params = params || [];
params.unshift(panorama);
-console.log(params);
postPanoramaInit.apply(self, params);
});
} else {
@@ -727,9 +726,18 @@ function nativeCallback(params) {
function postPanoramaInit(panorama, div, options) {
var self = this;
var mapId = panorama.getId();
- var args = [];
self.isThereAnyChange = true;
+
+ if (!common.isDom(div)) {
+ console.error('[GoogleMaps] You need to specify a dom element(such as <div>) for this method', div);
+ return;
+ }
+ if (div.offsetWidth < 100 || div.offsetHeight < 100) {
+ console.error('[GoogleMaps] Minimum container dimention is 100x100 in pixels.', div);
+ return;
+ }
+
// If the mapDiv is specified,
// the native side needs to know the map div position
// before creating the map view.
@@ -792,6 +800,10 @@ function postMapInit(map, div, options) {
var args = [];
if (common.isDom(div)) {
+ if (div.offsetWidth < 100 || div.offsetHeight < 100) {
+ console.error('[GoogleMaps] Minimum container dimention is 100x100 in pixels.', div);
+ return;
+ }
// If the mapDiv is specified,
// the native side needs to know the map div position
// before creating the map view.

Add warning if the div is too small.