Renaming handleWriteOptions to applyWriteOptions

This commit is contained in:
ahocevar
2013-08-04 12:55:18 +02:00
parent 3ebbdbb48f
commit 0aed05a413
5 changed files with 28 additions and 28 deletions

View File

@@ -627,13 +627,13 @@ ol.parser.ogc.GML.prototype.readFeaturesWithMetadataFromString =
/**
* Handle the writeOptions passed into the write function.
* Applies the writeOptions passed into the write function.
* @param {ol.parser.ReadFeaturesResult} obj Object structure to write out as
* GML.
* @param {ol.parser.GMLWriteOptions=} opt_options Write options.
*/
ol.parser.ogc.GML.prototype.handleWriteOptions = function(obj, opt_options) {
// srsName handling: opt_options takes precedence over obj.metadata
ol.parser.ogc.GML.prototype.applyWriteOptions = function(obj, opt_options) {
// srsName handling: opt_options -> this.writeOptions -> obj.metadata
var srsName;
if (goog.isDef(opt_options) && goog.isDef(opt_options.srsName)) {
srsName = opt_options.srsName;
@@ -643,9 +643,9 @@ ol.parser.ogc.GML.prototype.handleWriteOptions = function(obj, opt_options) {
} else if (goog.isDef(obj.metadata)) {
srsName = obj.metadata.projection;
}
goog.asserts.assert(goog.isDef(srsName));
goog.asserts.assert(goog.isDef(srsName), 'srsName required for writing GML');
this.srsName = goog.isString(srsName) ? srsName : srsName.getCode();
// axisOrientation handling
// axisOrientation handling: opt_options -> this.writeOptions
if (goog.isDef(opt_options) && goog.isDef(opt_options.axisOrientation)) {
this.axisOrientation = opt_options.axisOrientation;
} else if (goog.isDef(this.writeOptions) &&

View File

@@ -120,7 +120,7 @@ goog.inherits(ol.parser.ogc.GML_v2, ol.parser.ogc.GML);
* @return {string} A string representing the GML document.
*/
ol.parser.ogc.GML_v2.prototype.write = function(obj, opt_options) {
this.handleWriteOptions(obj, opt_options);
this.applyWriteOptions(obj, opt_options);
var root = this.writeNode('FeatureCollection', obj.features,
'http://www.opengis.net/wfs');
this.setAttributeNS(

View File

@@ -419,7 +419,7 @@ goog.inherits(ol.parser.ogc.GML_v3, ol.parser.ogc.GML);
* @return {string} An string representing the XML document.
*/
ol.parser.ogc.GML_v3.prototype.write = function(obj, opt_options) {
this.handleWriteOptions(obj, opt_options);
this.applyWriteOptions(obj, opt_options);
var root = this.writeNode('featureMembers', obj.features);
this.setAttributeNS(
root, 'http://www.w3.org/2001/XMLSchema-instance',