Fix: map.addKmlOverlay throw "self.map.addMarker(...).then is not a function"
MODIFY
www/KmlLoader.js
www/KmlLoader.js
@@ -587,34 +587,7 @@ KmlLoader.prototype.parsePointTag = function(params, callback) {
});
//console.log(markerOptions);
- (new Promise(function(resolve, reject) {
- // if (markerOptions.icon && markerOptions.icon.color) {
- // var image = new Image();
- // image.onload = function() {
- //
- // var canvas = document.createElement("canvas");
- // var ctx = canvas.getContext('2d');
- // canvas.width = image.width;
- // canvas.height = image.height;
- // ctx.fillStyle = 'rgba(' + markerOptions.icon.color.join(',') + ')';
- // ctx.fillRect(0, 0, image.width, image.height);
- // ctx.drawImage(image, 0, 0);
- // markerOptions.icon.url = canvas.toDataURL();
- // delete markerOptions.icon.color;
- // self.map.addMarker(markerOptions, resolve);
- // };
- // image.onerror = function(e) {
- // //console.warn(e.message || "Can not load " + markerOptions.icon.url);
- // delete markerOptions.icon.color;
- // self.map.addMarker(markerOptions, resolve);
- // };
- //
- // image.src = markerOptions.icon.url;
- // } else {
- self.map.addMarker(markerOptions).then(resolve).catch(reject);
- // }
- })).then(callback);
-
+ self.map.addMarker(markerOptions, callback);
};
function findTag(children, tagName, fieldName) {

Fix: map.addKmlOverlay throw "self.map.addMarker(...).then is not a function" #2544