make sure we can also read in CDATA fields with newlines

This commit is contained in:
Bart van den Eijnden
2013-11-27 16:09:36 +01:00
parent 9895c0f084
commit 73a2ab2de1
2 changed files with 14 additions and 1 deletions

View File

@@ -75,7 +75,7 @@ ol.parser.KML = function(opt_options) {
'*': function(node, obj) {
if (this.extractAttributes === true) {
var len = node.childNodes.length;
if ((len === 1 || len === 2) && (node.firstChild.nodeType === 3 ||
if (len > 0 && (node.firstChild.nodeType === 3 ||
node.firstChild.nodeType === 4)) {
var readers = this.readers[this.defaultNamespaceURI];
readers['_attribute'].apply(this, arguments);