Don't store private function into SimpleGeometry class

This commit is contained in:
Frederic Junod
2017-12-21 08:39:20 +01:00
parent bcc2bc797a
commit dc5cd438cd
+3 -4
View File
@@ -48,10 +48,9 @@ inherits(SimpleGeometry, Geometry);
/** /**
* @param {number} stride Stride. * @param {number} stride Stride.
* @private
* @return {ol.geom.GeometryLayout} layout Layout. * @return {ol.geom.GeometryLayout} layout Layout.
*/ */
SimpleGeometry.getLayoutForStride_ = function(stride) { function getLayoutForStride(stride) {
var layout; var layout;
if (stride == 2) { if (stride == 2) {
layout = GeometryLayout.XY; layout = GeometryLayout.XY;
@@ -61,7 +60,7 @@ SimpleGeometry.getLayoutForStride_ = function(stride) {
layout = GeometryLayout.XYZM; layout = GeometryLayout.XYZM;
} }
return /** @type {ol.geom.GeometryLayout} */ (layout); return /** @type {ol.geom.GeometryLayout} */ (layout);
}; }
/** /**
@@ -242,7 +241,7 @@ SimpleGeometry.prototype.setLayout = function(layout, coordinates, nesting) {
} }
} }
stride = coordinates.length; stride = coordinates.length;
layout = SimpleGeometry.getLayoutForStride_(stride); layout = getLayoutForStride(stride);
} }
this.layout = layout; this.layout = layout;
this.stride = stride; this.stride = stride;