Skip to content

Commit

Permalink
use leaflet smooth factor (bbecquet#18) to fix bbecquet#1
Browse files Browse the repository at this point in the history
  • Loading branch information
thiphariel committed Jan 15, 2020
1 parent 958f23b commit ce09ab0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions leaflet.polylineoffset.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ var PolylineOffset = {
return offsetSegments;
},

offsetPoints: function(pts, offset) {
var offsetSegments = this.offsetPointLine(pts, offset);
return this.joinLineSegments(offsetSegments, offset);
offsetPoints: function(pts, options) {
var offsetSegments = this.offsetPointLine(L.LineUtil.simplify(pts, options.smoothFactor), options.offset);
return this.joinLineSegments(offsetSegments, options.offset);
},

/**
Expand Down Expand Up @@ -199,7 +199,7 @@ L.Polyline.include({

// Offset management hack ---
if (this.options.offset) {
ring = L.PolylineOffset.offsetPoints(ring, this.options.offset);
ring = L.PolylineOffset.offsetPoints(ring, this.options);
}
// Offset management hack END ---

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "leaflet-polylineoffset",
"version": "1.1.1",
"name": "leaflet-polylineoffset-lc",
"version": "1.2.0",
"description": "Apply a relative pixel offset to polylines without changing their coordinates.",
"main": "leaflet.polylineoffset.js",
"directories": {
Expand All @@ -11,7 +11,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/bbecquet/Leaflet.PolylineOffset.git"
"url": "git+https://github.com/Latitude-Cartagene/Leaflet.PolylineOffset.git"
},
"keywords": [
"map",
Expand All @@ -24,7 +24,7 @@
"author": "Benjamin Becquet",
"license": "MIT",
"bugs": {
"url": "https://github.com/bbecquet/Leaflet.PolylineOffset/issues"
"url": "https://github.com/Latitude-Cartagene/Leaflet.PolylineOffset/issues"
},
"homepage": "https://github.com/bbecquet/Leaflet.PolylineOffset#readme"
}
"homepage": "https://github.com/Latitude-Cartagene/Leaflet.PolylineOffset#readme"
}

0 comments on commit ce09ab0

Please sign in to comment.