Implement read/write transforms for ol.format.Polyline

This commit is contained in:
tsauerwein
2014-08-11 11:59:27 +02:00
parent f8560df793
commit 48ed2e861e
6 changed files with 119 additions and 41 deletions

View File

@@ -146,3 +146,24 @@ ol.format.Feature.transformWithOptions = function(
return geometry;
}
};
/**
* @param {(olx.format.WriteOptions|olx.format.ReadOptions)=} opt_options
* Options.
* @param {ol.proj.ProjectionLike} defaultDataProjection Default projection.
* @protected
* @return {(olx.format.WriteOptions|olx.format.ReadOptions)=} Updated options.
*/
ol.format.Feature.setDefaultDataProjection = function(
opt_options, defaultDataProjection) {
if (goog.isDef(opt_options)) {
if (!goog.isDef(opt_options.dataProjection)) {
opt_options = {
featureProjection: opt_options.featureProjection,
dataProjection: defaultDataProjection
};
}
}
return opt_options;
};