fix: color of linestring is lost
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.2.0-beta-20180119-0028" 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.2.0-beta-20180119-1431" 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/BaseArrayClass.js
www/BaseArrayClass.js
@@ -75,6 +75,7 @@ BaseArrayClass.prototype.mapAsync = function(fn, callback) {
}
for (i = 0; i < self[ARRAY_FIELD].length; i++) {
(function(item, idx) {
+ nextTick(function() {
fn.call(self, item, function(value) {
results[idx] = value;
finishCnt++;
@@ -82,6 +83,7 @@ BaseArrayClass.prototype.mapAsync = function(fn, callback) {
callback.call(self, results);
}
});
+ });
})(self[ARRAY_FIELD][i], i);
}
};
@@ -127,7 +129,16 @@ BaseArrayClass.prototype.forEachAsync = function(fn, callback) {
return;
}
- self[ARRAY_FIELD].forEach(fn.bind(self));
+ for (var i = 0; i < self[ARRAY_FIELD].length; i++) {
+ (function(item, idx) {
+ fn.call(self, item, function() {
+ finishCnt++;
+ if (finishCnt === _arrayLength) {
+ callback.call(self);
+ }
+ });
+ })(self[ARRAY_FIELD][i], i);
+ }
};
BaseArrayClass.prototype.forEach = function(fn, callback) {

MODIFY
www/KmlLoader.js
www/KmlLoader.js
@@ -654,7 +654,7 @@ KmlLoader.prototype.parsePolygonTag = function(params, callback) {
polygonOptions.strokeColor = kmlColorToRGBA(node.value);
break;
case "width":
- polygonOptions.strokeWidth = parseInt(node.value);
+ polygonOptions.strokeWidth = parseFloat(node.value);
break;
}
});
@@ -689,6 +689,7 @@ KmlLoader.prototype.parsePolygonTag = function(params, callback) {
};
KmlLoader.prototype.parseLineStringTag = function(params, callback) {
+ //console.log(JSON.parse(JSON.stringify(params)));
var self = this;
//--------------
// add a polyline
@@ -709,16 +710,16 @@ KmlLoader.prototype.parseLineStringTag = function(params, callback) {
}
params.styles.children.forEach(function(style) {
+console.log(style);
switch (style.tagName) {
case "linestyle":
- var keys = Object.keys(style);
- keys.forEach(function(key) {
- switch(key) {
+ style.children.forEach(function(node) {
+ switch(node.tagName) {
case "color":
- polylineOptions.color = kmlColorToRGBA(style.color);
+ polylineOptions.color = kmlColorToRGBA(node.value);
break;
case "width":
- polylineOptions.width = parseInt(style.width);
+ polylineOptions.width = parseFloat(node.value);
break;
}
});

fix: color of linestring is lost