Skip to content

Commit

Permalink
L.multipolyline doesn't exist (#515)
Browse files Browse the repository at this point in the history
* L.polyline accepts either array of polylines or a single polyline

* added news line
  • Loading branch information
schloerke authored Apr 6, 2018
1 parent 7e3b374 commit 8d54fd4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ BREAKING CHANGES

BUG FIXES AND FEATURES

* `L.multiPolyline` was absorbed into `L.polyline`, which accepts multiple an array of polyline information. http://leafletjs.com/reference-1.3.0.html#polyline. (#515)

* Fix bug where icons where anchored to the top-center, not center-center (2a60751)

* Fix bug where markers would not appear in self contained knitr files (cc79bc3)
Expand Down
2 changes: 1 addition & 1 deletion inst/htmlwidgets/leaflet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@ methods.addPolylines = function (polygons, layerId, group, options, popup, popup
return _htmlwidgets2.default.dataframeToD3(shape[0]);
});
if (shapes.length > 1) {
return _leaflet2.default.multiPolyline(shapes, df.get(i));
return _leaflet2.default.polyline(shapes, df.get(i));
} else {
return _leaflet2.default.polyline(shapes[0], df.get(i));
}
Expand Down
4 changes: 2 additions & 2 deletions javascript/src/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,8 @@ methods.addPolylines = function(polygons, layerId, group, options, popup, popupO
addLayers(this, "shape", df, function(df, i) {
let shapes = df.get(i, "shapes");
shapes = shapes.map(shape => HTMLWidgets.dataframeToD3(shape[0]));
if(shapes.length>1) {
return L.multiPolyline(shapes, df.get(i));
if(shapes.length > 1) {
return L.polyline(shapes, df.get(i));
} else {
return L.polyline(shapes[0], df.get(i));
}
Expand Down

0 comments on commit 8d54fd4

Please sign in to comment.