Skip to content

Commit

Permalink
Go back to turf.pointOnLine
Browse files Browse the repository at this point in the history
Waypoint interpolation strategy #3, like strategy #1, uses
turf.pointOnLine. This essentially reverts commit 3f454d9.
  • Loading branch information
KlaasH committed Nov 11, 2016
1 parent 1ca6728 commit a69a79c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion python/cac_tripplanner/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<script src="{% static 'scripts/vendor/typeahead.bundle.js' %}"></script>
<script src="{% static 'scripts/vendor/leaflet.awesome-markers.js' %}"></script>
<script src="{% static 'scripts/vendor/turf-helpers.js' %}"></script>
<script src="{% static 'scripts/vendor/turf-nearest.js' %}"></script>
<script src="{% static 'scripts/vendor/turf-point-on-line.js' %}"></script>
<script src="{% static 'scripts/vendor/moment.js' %}"></script>
<script src="{% static 'scripts/vendor/moment-duration-format.js' %}"></script>
<script src="{% static 'scripts/vendor/bootstrap-datetimepicker.min.js' %}"></script>
Expand Down
21 changes: 11 additions & 10 deletions src/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,31 +73,32 @@ gulp.task('collectstatic', function () {
});

// turf module needs to be run through browserify to pack it with its dependencies
var turfDistanceRoot = './node_modules/@turf/nearest/node_modules/@turf/distance';
var turfRoot = './node_modules/@turf/point-on-line';

var buildTurfHelpers = function() {
return browserify(turfDistanceRoot + '/node_modules/@turf/helpers', {
return browserify(turfRoot + '/node_modules/@turf/helpers', {
standalone: 'turf',
expose: ['helpers']
})
.require(turfDistanceRoot + '/node_modules/@turf/helpers',
.require(turfRoot + '/node_modules/@turf/helpers',
{expose: 'turf-helpers'})
.bundle()
.pipe(vinylSourceStream('turf-helpers.js'));
};

var buildTurfPointOnLine = function() {
return browserify('./node_modules/@turf/nearest', {
standalone: 'turf.nearest',
exclude: [turfDistanceRoot + '/node_modules/@turf/helpers']
return browserify('./node_modules/@turf/point-on-line', {
standalone: 'turf.pointOnLine',
exclude: [turfRoot + '/node_modules/@turf/helpers']
})
.transform(aliasify, {aliases: {
'turf-helpers': turfDistanceRoot + '/node_modules/@turf/helpers',
'turf-invariant': turfDistanceRoot + '/node_modules/@turf/invariant',
'turf-distance': turfDistanceRoot
'turf-helpers': turfRoot + '/node_modules/@turf/helpers',
'turf-distance': turfRoot + '/node_modules/@turf/distance',
'turf-bearing': turfRoot + '/node_modules/@turf/bearing',
'turf-destination': turfRoot + '/node_modules/@turf/destination'
}})
.bundle()
.pipe(vinylSourceStream('turf-nearest.js'));
.pipe(vinylSourceStream('turf-point-on-line.js'));
};

// combine streams from turf and the other vendor dependencies
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"node": ">=0.12.0"
},
"dependencies": {
"@turf/nearest": "~3.5.2"
"@turf/point-on-line": "~3.5.3"
},
"devDependencies": {
"aliasify": "^2.0.0",
Expand Down

0 comments on commit a69a79c

Please sign in to comment.