This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Accepts an ol.geom.LineString instance and a number (the desired number of segments) as parameters | |
*/ | |
var splitLineString = function(geometry, n) { | |
var splitPoints = new Array(n); | |
var coords = geometry.getCoordinates(); | |
var coordIndex = 0; | |
var startPoint = coords[coordIndex]; | |
var nextPoint = coords[coordIndex + 1]; | |
var segmentLength = geometry.getLength() / n; |