Move layout test in ol.geom.LineString
This commit is contained in:
@@ -310,16 +310,13 @@ ol.geom.flat.lineStringInterpolate =
|
|||||||
* @param {number} offset Offset.
|
* @param {number} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {ol.geom.GeometryLayout} layout Layout.
|
|
||||||
* @param {number} m M.
|
* @param {number} m M.
|
||||||
* @param {boolean} extrapolate Extrapolate.
|
* @param {boolean} extrapolate Extrapolate.
|
||||||
* @return {ol.Coordinate} Coordinate.
|
* @return {ol.Coordinate} Coordinate.
|
||||||
*/
|
*/
|
||||||
ol.geom.flat.lineStringCoordinateAtM =
|
ol.geom.flat.lineStringCoordinateAtM =
|
||||||
function(flatCoordinates, offset, end, stride, layout, m, extrapolate) {
|
function(flatCoordinates, offset, end, stride, m, extrapolate) {
|
||||||
if ((layout != ol.geom.GeometryLayout.XYM &&
|
if (end == offset) {
|
||||||
layout != ol.geom.GeometryLayout.XYZM) ||
|
|
||||||
end == offset) {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
var coordinate;
|
var coordinate;
|
||||||
|
|||||||
@@ -86,9 +86,13 @@ ol.geom.LineString.prototype.closestPointXY =
|
|||||||
* @return {ol.Coordinate} Coordinate.
|
* @return {ol.Coordinate} Coordinate.
|
||||||
*/
|
*/
|
||||||
ol.geom.LineString.prototype.getCoordinateAtM = function(m, opt_extrapolate) {
|
ol.geom.LineString.prototype.getCoordinateAtM = function(m, opt_extrapolate) {
|
||||||
|
if (this.layout != ol.geom.GeometryLayout.XYM &&
|
||||||
|
this.layout != ol.geom.GeometryLayout.XYZM) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
var extrapolate = goog.isDef(opt_extrapolate) ? opt_extrapolate : false;
|
var extrapolate = goog.isDef(opt_extrapolate) ? opt_extrapolate : false;
|
||||||
return ol.geom.flat.lineStringCoordinateAtM(this.flatCoordinates, 0,
|
return ol.geom.flat.lineStringCoordinateAtM(this.flatCoordinates, 0,
|
||||||
this.flatCoordinates.length, this.stride, this.layout, m, extrapolate);
|
this.flatCoordinates.length, this.stride, m, extrapolate);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user