Named export for SimpleGeometry.getStrideForLayout function

This commit is contained in:
Frederic Junod
2017-12-21 08:43:19 +01:00
parent dc5cd438cd
commit 6d4621baeb
2 changed files with 6 additions and 6 deletions

View File

@@ -67,7 +67,7 @@ function getLayoutForStride(stride) {
* @param {ol.geom.GeometryLayout} layout Layout.
* @return {number} Stride.
*/
SimpleGeometry.getStrideForLayout = function(layout) {
export function getStrideForLayout(layout) {
var stride;
if (layout == GeometryLayout.XY) {
stride = 2;
@@ -77,7 +77,7 @@ SimpleGeometry.getStrideForLayout = function(layout) {
stride = 4;
}
return /** @type {number} */ (stride);
};
}
/**
@@ -204,7 +204,7 @@ SimpleGeometry.prototype.getStride = function() {
* @protected
*/
SimpleGeometry.prototype.setFlatCoordinatesInternal = function(layout, flatCoordinates) {
this.stride = SimpleGeometry.getStrideForLayout(layout);
this.stride = getStrideForLayout(layout);
this.layout = layout;
this.flatCoordinates = flatCoordinates;
};
@@ -228,7 +228,7 @@ SimpleGeometry.prototype.setLayout = function(layout, coordinates, nesting) {
/** @type {number} */
var stride;
if (layout) {
stride = SimpleGeometry.getStrideForLayout(layout);
stride = getStrideForLayout(layout);
} else {
var i;
for (i = 0; i < nesting; ++i) {