Handle concrete classes with non implemented abstract methods

This commit is contained in:
Guillaume Beraudo
2017-01-13 23:39:39 +01:00
parent 7a7c01a074
commit b54ea89395
8 changed files with 105 additions and 13 deletions
+8
View File
@@ -101,11 +101,19 @@ ol.interaction.DragAndDrop.prototype.handleResult_ = function(file, event) {
var view = map.getView();
projection = view.getProjection();
}
var formatConstructors = this.formatConstructors_;
var features = [];
var i, ii;
for (i = 0, ii = formatConstructors.length; i < ii; ++i) {
/**
* Avoid "cannot instantiate abstract class" error.
* @type {Function}
*/
var formatConstructor = formatConstructors[i];
/**
* @type {ol.format.Feature}
*/
var format = new formatConstructor();
features = this.tryReadFeatures_(format, result, {
featureProjection: projection