Merge pull request #1427 from twpayne/vector-api-hosted
[vector-api] Miscellaneous fixes for hosted examples
This commit is contained in:
@@ -277,8 +277,8 @@
|
|||||||
/**
|
/**
|
||||||
* @typedef {Object} olx.interaction.DragAndDropOptions
|
* @typedef {Object} olx.interaction.DragAndDropOptions
|
||||||
* @property {boolean|undefined} fitView Fit view. Default is `true`.
|
* @property {boolean|undefined} fitView Fit view. Default is `true`.
|
||||||
* @property {Array.<function(new: ol.format.Format)>|undefined}
|
* @property {Array.<function(new: ol.format.Format)>|undefined} formatConstructors
|
||||||
* formatConstructors Format constructors.
|
* Format constructors.
|
||||||
* @property {ol.source.Vector|undefined} source Source. If this is defined
|
* @property {ol.source.Vector|undefined} source Source. If this is defined
|
||||||
* then features will be added to this source.
|
* then features will be added to this source.
|
||||||
* @property {ol.layer.Vector|undefined} layer Layer. If this is defined then
|
* @property {ol.layer.Vector|undefined} layer Layer. If this is defined then
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ ol.format.GeoJSON.prototype.readFeaturesFromObject = function(object) {
|
|||||||
return features;
|
return features;
|
||||||
} else {
|
} else {
|
||||||
goog.asserts.fail();
|
goog.asserts.fail();
|
||||||
return null;
|
return [];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ ol.format.XML.prototype.readFeatures = function(source) {
|
|||||||
return this.readFeaturesFromDocument(doc);
|
return this.readFeaturesFromDocument(doc);
|
||||||
} else {
|
} else {
|
||||||
goog.asserts.fail();
|
goog.asserts.fail();
|
||||||
return null;
|
return [];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
goog.provide('ol.source.VectorFile');
|
goog.provide('ol.source.VectorFile');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
|
goog.require('goog.dom.xml');
|
||||||
goog.require('goog.net.XhrIo');
|
goog.require('goog.net.XhrIo');
|
||||||
goog.require('ol.format.FormatType');
|
goog.require('ol.format.FormatType');
|
||||||
goog.require('ol.proj');
|
goog.require('ol.proj');
|
||||||
@@ -83,6 +84,9 @@ ol.source.VectorFile.prototype.handleXhrIo_ = function(event) {
|
|||||||
source = xhrIo.getResponseText();
|
source = xhrIo.getResponseText();
|
||||||
} else if (type == ol.format.FormatType.XML) {
|
} else if (type == ol.format.FormatType.XML) {
|
||||||
source = xhrIo.getResponseXml();
|
source = xhrIo.getResponseXml();
|
||||||
|
if (goog.isNull(source)) {
|
||||||
|
source = goog.dom.xml.loadXml(xhrIo.getResponseText());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
goog.asserts.fail();
|
goog.asserts.fail();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user