Skip to content

Commit b7874d2

Browse files
committed
Update line-split docs to make end result more clear
1 parent f08d4dc commit b7874d2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/turf-line-split/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ var splitter = turf.lineString([[130, -15], [130, -35]]);
2020
var split = turf.lineSplit(line, splitter);
2121

2222
//addToMap
23-
var addToMap = [line, splitter]
23+
var addToMap = [line, splitter, split]
24+
25+
split.features[0].properties.stroke = "red";
26+
split.features[1].properties.stroke = "blue";
2427
```
2528

2629
Returns **[FeatureCollection][3]<[LineString][2]>** Split LineStrings

packages/turf-line-split/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ import { lineString, featureCollection } from "@turf/helpers";
2424
*
2525
* //addToMap
2626
* var addToMap = [line, splitter, split]
27+
*
28+
* split.features[0].properties.stroke = "red";
29+
* split.features[1].properties.stroke = "blue";
2730
*/
2831
function lineSplit(line, splitter) {
2932
if (!line) throw new Error("line is required");

0 commit comments

Comments
 (0)