diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index cd017c42a8..a850ab4bdb 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -39,7 +39,8 @@ The map and sources no longer accept a `logo` option. Instead, if you wish to a The following methods did get the optional this (i.e. opt_this) arguments removed. Please use closures, the es6 arrow function or the bind method to achieve this effect (Bind is explained here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind). -* ol.Collection#forEach +* Collection#forEach +* geom/LineString#forEachSegment ### v4.6.0 diff --git a/src/ol/geom/LineString.js b/src/ol/geom/LineString.js index 2cf40505fd..b336a56e9c 100644 --- a/src/ol/geom/LineString.js +++ b/src/ol/geom/LineString.js @@ -114,15 +114,13 @@ LineString.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDis * * @param {function(this: S, ol.Coordinate, ol.Coordinate): T} callback Function * called for each segment. - * @param {S=} opt_this The object to be used as the value of 'this' - * within callback. * @return {T|boolean} Value. * @template T,S * @api */ -LineString.prototype.forEachSegment = function(callback, opt_this) { +LineString.prototype.forEachSegment = function(callback) { return _ol_geom_flat_segments_.forEach(this.flatCoordinates, 0, - this.flatCoordinates.length, this.stride, callback, opt_this); + this.flatCoordinates.length, this.stride, callback); };