Work for kml overlay
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.0.10" 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.1.0-beta-20170920-0000" 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
src/android/plugin/google/maps/AsyncKmlParser.java
src/android/plugin/google/maps/AsyncKmlParser.java
@@ -183,7 +183,7 @@ public class AsyncKmlParser extends AsyncTask<String, Void, Bundle> {
-
+/*
if (kmlData == null) {
mCallback.error("KML Parse error");
@@ -213,7 +213,7 @@ public class AsyncKmlParser extends AsyncTask<String, Void, Bundle> {
e.printStackTrace();
}
-
+*/
return kmlData;
}
@@ -477,8 +477,7 @@ public class AsyncKmlParser extends AsyncTask<String, Void, Bundle> {
}
protected void onPostExecute(Bundle parseResult) {
-
- this.mCallback.success();
+ this.mCallback.success(PluginUtil.Bundle2Json(parseResult));
}

MODIFY
www/KmlOverlay.js
www/KmlOverlay.js
@@ -7,8 +7,9 @@ var argscheck = require('cordova/argscheck'),
* KmlOverlay Class
*****************************************************************************/
var exec;
-var KmlOverlay = function(map, kmlOverlayId, kmlOverlayOptions, _exec) {
+var KmlOverlay = function(map, kmlOverlayId, kmlData, _exec) {
BaseClass.apply(this);
+ console.log(kmlData);
var self = this;
self._overlays = [];
@@ -30,13 +31,14 @@ var KmlOverlay = function(map, kmlOverlayId, kmlOverlayOptions, _exec) {
value: map,
writable: false
});
+/*
var ignores = ["map", "id", "hashCode", "type"];
for (var key in kmlOverlayOptions) {
if (ignores.indexOf(key) === -1) {
self.set(key, kmlOverlayOptions[key]);
}
}
-
+*/
document.addEventListener(map.getId() + "_" + kmlOverlayId, function(event) {
console.log(event.placeMarkId);

MODIFY
www/Map.js
www/Map.js
@@ -775,21 +775,23 @@ Map.prototype.addKmlOverlay = function(kmlOverlayOptions, callback) {
var kmlId = "kml" + (Math.random() * 9999999).toFixed(0);
kmlOverlayOptions.kmlId = kmlId;
- var kmlOverlay = new KmlOverlay(self, kmlId, kmlOverlayOptions, exec);
+ exec.call(this, function(kmlData) {
+ var kmlOverlay = new KmlOverlay(self, kmlId, kmlData, exec);
self.OVERLAYS[kmlId] = kmlOverlay;
self.KML_LAYERS[kmlId] = kmlOverlay;
- exec.call(this, function() {
+/*
kmlOverlay.one(kmlId + "_remove", function() {
kmlOverlay.off();
delete self.KML_LAYERS[kmlId];
delete self.OVERLAYS[kmlId];
kmlOverlay = undefined;
});
+*/
if (typeof callback === "function") {
callback.call(self, kmlOverlay);
}
- }, self.errorHandler, self.id, 'loadPlugin', ['KmlOverlay', kmlOverlayOptions]);
+ }, self.errorHandler, self.id, 'loadPlugin', ['KmlOverlay', kmlOverlayOptions], {sync: true});
};

Work for kml overlay