Named exports from ol/geom/flat/topology

This commit is contained in:
Frederic Junod
2018-01-26 15:35:14 +01:00
parent 135f713236
commit 297fd14507
3 changed files with 11 additions and 15 deletions
+2 -4
View File
@@ -2,7 +2,6 @@
* @module ol/geom/flat/topology
*/
import {linearRing as linearRingArea} from '../flat/area.js';
const _ol_geom_flat_topology_ = {};
/**
* Check if the linestring is a boundary.
@@ -12,12 +11,11 @@ const _ol_geom_flat_topology_ = {};
* @param {number} stride Stride.
* @return {boolean} The linestring is a boundary.
*/
_ol_geom_flat_topology_.lineStringIsClosed = function(flatCoordinates, offset, end, stride) {
export function lineStringIsClosed(flatCoordinates, offset, end, stride) {
const lastCoord = end - stride;
if (flatCoordinates[offset] === flatCoordinates[lastCoord] &&
flatCoordinates[offset + 1] === flatCoordinates[lastCoord + 1] && (end - offset) / stride > 3) {
return !!linearRingArea(flatCoordinates, offset, end, stride);
}
return false;
};
export default _ol_geom_flat_topology_;
}