Functions in ol.geom.flat.interpolate namespace
This commit is contained in:
@@ -80,7 +80,7 @@ ol.geom.flat.interpolate.lineString = function(flatCoordinates, offset, end, str
|
|||||||
* @param {boolean} extrapolate Extrapolate.
|
* @param {boolean} extrapolate Extrapolate.
|
||||||
* @return {ol.Coordinate} Coordinate.
|
* @return {ol.Coordinate} Coordinate.
|
||||||
*/
|
*/
|
||||||
ol.geom.flat.lineStringCoordinateAtM = function(flatCoordinates, offset, end, stride, m, extrapolate) {
|
ol.geom.flat.interpolate.lineStringCoordinateAtM = function(flatCoordinates, offset, end, stride, m, extrapolate) {
|
||||||
if (end == offset) {
|
if (end == offset) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -147,10 +147,10 @@ ol.geom.flat.lineStringCoordinateAtM = function(flatCoordinates, offset, end, st
|
|||||||
* @param {boolean} interpolate Interpolate.
|
* @param {boolean} interpolate Interpolate.
|
||||||
* @return {ol.Coordinate} Coordinate.
|
* @return {ol.Coordinate} Coordinate.
|
||||||
*/
|
*/
|
||||||
ol.geom.flat.lineStringsCoordinateAtM = function(
|
ol.geom.flat.interpolate.lineStringsCoordinateAtM = function(
|
||||||
flatCoordinates, offset, ends, stride, m, extrapolate, interpolate) {
|
flatCoordinates, offset, ends, stride, m, extrapolate, interpolate) {
|
||||||
if (interpolate) {
|
if (interpolate) {
|
||||||
return ol.geom.flat.lineStringCoordinateAtM(
|
return ol.geom.flat.interpolate.lineStringCoordinateAtM(
|
||||||
flatCoordinates, offset, ends[ends.length - 1], stride, m, extrapolate);
|
flatCoordinates, offset, ends[ends.length - 1], stride, m, extrapolate);
|
||||||
}
|
}
|
||||||
var coordinate;
|
var coordinate;
|
||||||
@@ -181,12 +181,12 @@ ol.geom.flat.lineStringsCoordinateAtM = function(
|
|||||||
if (m < flatCoordinates[offset + stride - 1]) {
|
if (m < flatCoordinates[offset + stride - 1]) {
|
||||||
return null;
|
return null;
|
||||||
} else if (m <= flatCoordinates[end - 1]) {
|
} else if (m <= flatCoordinates[end - 1]) {
|
||||||
return ol.geom.flat.lineStringCoordinateAtM(
|
return ol.geom.flat.interpolate.lineStringCoordinateAtM(
|
||||||
flatCoordinates, offset, end, stride, m, false);
|
flatCoordinates, offset, end, stride, m, false);
|
||||||
}
|
}
|
||||||
offset = end;
|
offset = end;
|
||||||
}
|
}
|
||||||
ol.DEBUG && console.assert(false,
|
ol.DEBUG && console.assert(false,
|
||||||
'ol.geom.flat.lineStringsCoordinateAtM should have returned');
|
'ol.geom.flat.interpolate.lineStringsCoordinateAtM should have returned');
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ ol.geom.LineString.prototype.getCoordinateAtM = function(m, opt_extrapolate) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
var extrapolate = opt_extrapolate !== undefined ? opt_extrapolate : false;
|
var extrapolate = opt_extrapolate !== undefined ? opt_extrapolate : false;
|
||||||
return ol.geom.flat.lineStringCoordinateAtM(this.flatCoordinates, 0,
|
return ol.geom.flat.interpolate.lineStringCoordinateAtM(this.flatCoordinates, 0,
|
||||||
this.flatCoordinates.length, this.stride, m, extrapolate);
|
this.flatCoordinates.length, this.stride, m, extrapolate);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ ol.geom.MultiLineString.prototype.getCoordinateAtM = function(m, opt_extrapolate
|
|||||||
}
|
}
|
||||||
var extrapolate = opt_extrapolate !== undefined ? opt_extrapolate : false;
|
var extrapolate = opt_extrapolate !== undefined ? opt_extrapolate : false;
|
||||||
var interpolate = opt_interpolate !== undefined ? opt_interpolate : false;
|
var interpolate = opt_interpolate !== undefined ? opt_interpolate : false;
|
||||||
return ol.geom.flat.lineStringsCoordinateAtM(this.flatCoordinates, 0,
|
return ol.geom.flat.interpolate.lineStringsCoordinateAtM(this.flatCoordinates, 0,
|
||||||
this.ends_, this.stride, m, extrapolate, interpolate);
|
this.ends_, this.stride, m, extrapolate, interpolate);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user