Named export for SimpleGeometry.getStrideForLayout function
This commit is contained in:
@@ -8,7 +8,7 @@ import FeatureFormat from '../format/Feature.js';
|
||||
import TextFeature from '../format/TextFeature.js';
|
||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import SimpleGeometry from '../geom/SimpleGeometry.js';
|
||||
import {getStrideForLayout} from '../geom/SimpleGeometry.js';
|
||||
import _ol_geom_flat_flip_ from '../geom/flat/flip.js';
|
||||
import _ol_geom_flat_inflate_ from '../geom/flat/inflate.js';
|
||||
import {get as getProjection} from '../proj.js';
|
||||
@@ -324,7 +324,7 @@ Polyline.prototype.readGeometry;
|
||||
* @inheritDoc
|
||||
*/
|
||||
Polyline.prototype.readGeometryFromText = function(text, opt_options) {
|
||||
var stride = SimpleGeometry.getStrideForLayout(this.geometryLayout_);
|
||||
var stride = getStrideForLayout(this.geometryLayout_);
|
||||
var flatCoordinates = Polyline.decodeDeltas(
|
||||
text, stride, this.factor_);
|
||||
_ol_geom_flat_flip_.flipXY(
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user