Change getInteriorPoint type to XYM with intersection length as M

This commit is contained in:
Andreas Hocevar
2017-09-27 18:06:05 +02:00
parent c75040e7d8
commit 7a3e11b9e4
5 changed files with 37 additions and 8 deletions
+6 -4
View File
@@ -14,7 +14,8 @@ goog.require('ol.geom.flat.contains');
* @param {Array.<number>} flatCenters Flat centers.
* @param {number} flatCentersOffset Flat center offset.
* @param {Array.<number>=} opt_dest Destination.
* @return {Array.<number>} Destination.
* @return {Array.<number>} Destination point as XYM coordinate, where M is the
* length of the horizontal intersection that the point belongs to.
*/
ol.geom.flat.interiorpoint.linearRings = function(flatCoordinates, offset,
ends, stride, flatCenters, flatCentersOffset, opt_dest) {
@@ -61,10 +62,10 @@ ol.geom.flat.interiorpoint.linearRings = function(flatCoordinates, offset,
pointX = flatCenters[flatCentersOffset];
}
if (opt_dest) {
opt_dest.push(pointX, y);
opt_dest.push(pointX, y, maxSegmentLength);
return opt_dest;
} else {
return [pointX, y];
return [pointX, y, maxSegmentLength];
}
};
@@ -75,7 +76,8 @@ ol.geom.flat.interiorpoint.linearRings = function(flatCoordinates, offset,
* @param {Array.<Array.<number>>} endss Endss.
* @param {number} stride Stride.
* @param {Array.<number>} flatCenters Flat centers.
* @return {Array.<number>} Interior points.
* @return {Array.<number>} Interior points as XYM coordinates, where M is the
* length of the horizontal intersection that the point belongs to.
*/
ol.geom.flat.interiorpoint.linearRingss = function(flatCoordinates, offset, endss, stride, flatCenters) {
var interiorPoints = [];