Bug fix: TileOverlay can not be shown
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.0.9-beta-20170918-1858" 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.0.9-beta-20170918-2233" 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/Map.js
www/Map.js
@@ -865,18 +865,20 @@ Map.prototype.addTileOverlay = function(tilelayerOptions, callback) {
_id : Math.floor(Math.random() * Date.now())
};
- document.addEventListener(self.id + "-" + options._id + "-tileoverlay", function(params) {
+ var onNativeCallback = function(params) {
var url = tilelayerOptions.getTile(params.x, params.y, params.zoom);
if (!url || url === "(null)" || url === "undefined" || url === "null") {
url = "(null)";
}
- exec.call(this, null, self.errorHandler, self.id + "-tileoverlay", 'onGetTileUrlFromJS', [options._id, params.key, url]);
- });
+ cordova_exec(null, self.errorHandler, self.id + "-tileoverlay", 'onGetTileUrlFromJS', [options._id, params.key, url]);
+ };
+ document.addEventListener(self.id + "-" + options._id + "-tileoverlay", onNativeCallback);
exec.call(this, function(result) {
var tileOverlay = new TileOverlay(self, result.id, tilelayerOptions, exec);
self.OVERLAYS[result.id] = tileOverlay;
tileOverlay.one(result.id + "_remove", function() {
+ document.removeEventListener(self.id + "-" + options._id + "-tileoverlay", onNativeCallback);
tileOverlay.off();
delete self.OVERLAYS[result.id];
tileOverlay = undefined;

Bug fix: TileOverlay can not be shown #1750