MCPcopy Create free account
hub / github.com/microsoft/SandDance / normalizePath

Function normalizePath

docs/app/js/sanddance-app.js:101515–101530  ·  view source on GitHub ↗
(path, size, gridResolution, wrapLongitude)

Source from the content-addressed store, hash-verified

101513parcelHelpers.export(exports, "normalizePath", ()=>normalizePath);
101514var _polygon = require("@math.gl/polygon");
101515function normalizePath(path, size, gridResolution, wrapLongitude) {
101516 var flatPath = path;
101517 if (Array.isArray(path[0])) {
101518 var length = path.length * size;
101519 flatPath = new Array(length);
101520 for(var i = 0; i < path.length; i++)for(var j = 0; j < size; j++)flatPath[i * size + j] = path[i][j] || 0;
101521 }
101522 if (gridResolution) return (0, _polygon.cutPolylineByGrid)(flatPath, {
101523 size: size,
101524 gridResolution: gridResolution
101525 });
101526 if (wrapLongitude) return (0, _polygon.cutPolylineByMercatorBounds)(flatPath, {
101527 size: size
101528 });
101529 return flatPath;
101530}
101531
101532},{"@math.gl/polygon":"e5A4M","@parcel/transformer-js/src/esmodule-helpers.js":"jA2du"}],"e5A4M":[function(require,module,exports) {
101533var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected