From ccd01fb874a8693515c5ff7e3c48578fe582a29b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Fri, 27 Jun 2014 10:56:01 +0200 Subject: [PATCH] Add ol.format.XSD.writeBooleanTextNode --- src/ol/format/kmlformat.js | 14 ++------------ src/ol/format/xsdformat.js | 9 +++++++++ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/ol/format/kmlformat.js b/src/ol/format/kmlformat.js index 397df12db3..fa0e0068c0 100644 --- a/src/ol/format/kmlformat.js +++ b/src/ol/format/kmlformat.js @@ -1657,16 +1657,6 @@ ol.format.KML.prototype.readProjectionFromNode = function(node) { }; -/** - * @param {Node} node Node to append a TextNode with the boolean to. - * @param {boolean} bool Boolean. - * @private - */ -ol.format.KML.writeBooleanTextNode_ = function(node, bool) { - ol.format.XSD.writeStringTextNode(node, (bool) ? '1' : '0'); -}; - - /** * @param {Node} node Node to append a TextNode with the color to. * @param {ol.Color|string} color Color. @@ -2309,12 +2299,12 @@ ol.format.KML.PLACEMARK_SERIALIZERS_ = ol.xml.makeStructureNS( 'description': ol.xml.makeChildAppender( ol.format.XSD.writeStringTextNode), 'name': ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode), - 'open': ol.xml.makeChildAppender(ol.format.KML.writeBooleanTextNode_), + 'open': ol.xml.makeChildAppender(ol.format.XSD.writeBooleanTextNode), 'phoneNumber': ol.xml.makeChildAppender( ol.format.XSD.writeStringTextNode), 'styleUrl': ol.xml.makeChildAppender(ol.format.XSD.writeStringTextNode), 'visibility': ol.xml.makeChildAppender( - ol.format.KML.writeBooleanTextNode_) + ol.format.XSD.writeBooleanTextNode) }); diff --git a/src/ol/format/xsdformat.js b/src/ol/format/xsdformat.js index f60fa4cc4f..5198859f93 100644 --- a/src/ol/format/xsdformat.js +++ b/src/ol/format/xsdformat.js @@ -126,6 +126,15 @@ ol.format.XSD.readString = function(node) { }; +/** + * @param {Node} node Node to append a TextNode with the boolean to. + * @param {boolean} bool Boolean. + */ +ol.format.XSD.writeBooleanTextNode = function(node, bool) { + ol.format.XSD.writeStringTextNode(node, (bool) ? '1' : '0'); +}; + + /** * @param {Node} node Node to append a TextNode with the dateTime to. * @param {number} dateTime DateTime in seconds.