Skip to content

Commit

Permalink
[VER]
Browse files Browse the repository at this point in the history
  • Loading branch information
Viglino committed Apr 27, 2022
1 parent 2e98b09 commit e35bad5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
36 changes: 32 additions & 4 deletions dist/ol-ext.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* ol-ext - A set of cool extensions for OpenLayers (ol) in node modules structure
* @description ol3,openlayers,popup,menu,symbol,renderer,filter,canvas,interaction,split,statistic,charts,pie,LayerSwitcher,toolbar,animation
* @version v3.2.23
* @version v3.2.24
* @author Jean-Marc Viglino
* @see https://github.com/Viglino/ol-ext#,
* @license BSD-3-Clause
Expand Down Expand Up @@ -35289,6 +35289,34 @@ ol.coordinate.sampleAt = function(p1, p2, d, start) {
pts.push(p2);
return pts;
};
/** Sample a LineString at a distance
* @param {number} d
* @returns {ol.geom.LineString}
*/
ol.geom.LineString.prototype.sampleAt = function(d) {
var line = this.getCoordinates();
var result = [];
for (var i=1; i<line.length; i++) {
result = result.concat(ol.coordinate.sampleAt(line[i-1], line[i], d, i===1));
}
return new ol.geom.LineString(result);
};
/** Sample a MultiLineString at a distance
* @param {number} d
* @returns {ol.geom.MultiLineString}
*/
ol.geom.MultiLineString.prototype.sampleAt = function(d) {
var lines = this.getCoordinates();
var result = [];
lines.forEach(function(p) {
var l = [];
for (var i=1; i<p.length; i++) {
l = l.concat(ol.coordinate.sampleAt(p[i-1], p[i], d, i===1));
}
result.push(l);
})
return new ol.geom.MultiLineString(result);
};
/** Sample a Polygon at a distance
* @param {number} d
* @returns {ol.geom.Polygon}
Expand Down Expand Up @@ -35383,9 +35411,9 @@ ol.geom.Circle.prototype.intersection = function(geom, resolution) {

/** Split a lineString by a point or a list of points
* NB: points must be on the line, use getClosestPoint() to get one
* @param {ol.Coordinate | Array<ol.Coordinate>} pt points to split the line
* @param {Number} tol distance tolerance for 2 points to be equal
*/
* @param {ol.Coordinate | Array<ol.Coordinate>} pt points to split the line
* @param {Number} tol distance tolerance for 2 points to be equal
*/
ol.geom.LineString.prototype.splitAt = function(pt, tol) {
var i;
if (!pt) return [this];
Expand Down
4 changes: 2 additions & 2 deletions dist/ol-ext.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ol-ext",
"version": "3.2.23",
"version": "3.2.24",
"description": "A set of cool extensions for OpenLayers (ol) in node modules structure",
"main": "dist/ol-ext.js",
"style": "dist/ol-ext.css",
Expand Down

0 comments on commit e35bad5

Please sign in to comment.