Put options on objectStack for xml formats

This commit is contained in:
tsauerwein
2014-08-19 09:42:44 +02:00
parent e7864be2be
commit b30ed6b934
12 changed files with 90 additions and 95 deletions

View File

@@ -250,39 +250,3 @@ ol.format.XMLFeature.prototype.writeGeometry = function(geometry, opt_options) {
* @return {Node} Node.
*/
ol.format.XMLFeature.prototype.writeGeometryNode = goog.abstractMethod;
/**
* @param {Array.<ol.Feature>} features Features.
* @param {boolean} write Set to true for writing, false for reading. For
* writing, the features will be cloned before transforming.
* @param {(olx.format.WriteOptions|olx.format.ReadOptions)=} opt_options
* Options.
* @protected
* @return {Array.<ol.Feature>} Features.
*/
ol.format.XMLFeature.transformFeaturesWithOptions = function(
features, write, opt_options) {
var featureProjection = goog.isDef(opt_options) ?
ol.proj.get(opt_options.featureProjection) : null;
var dataProjection = goog.isDef(opt_options) ?
ol.proj.get(opt_options.dataProjection) : null;
if (!goog.isNull(featureProjection) && !goog.isNull(dataProjection) &&
!ol.proj.equivalent(featureProjection, dataProjection)) {
if (write) {
features = goog.array.map(features, function(feature) {
return feature.clone();
});
}
goog.array.forEach(features, function(feature) {
var geom = feature.getGeometry();
if (goog.isDef(geom)) {
feature.setGeometry(ol.format.Feature.transformWithOptions(
geom, write, false, opt_options));
}
});
}
return features;
};