update leaflet-routing (rerouteAllSegments merged)

This commit is contained in:
Norbert Renner 2014-03-04 19:50:23 +01:00
parent d05bd937f3
commit aaa1a11709
5 changed files with 13 additions and 13 deletions

View file

@ -11,7 +11,7 @@
"leaflet-gpx": "mpetazzoni/leaflet-gpx", "leaflet-gpx": "mpetazzoni/leaflet-gpx",
"leaflet-search": "*", "leaflet-search": "*",
"leaflet-plugins": "*", "leaflet-plugins": "*",
"leaflet-routing": "nrenner/leaflet-routing#reroute", "leaflet-routing": "Turistforeningen/leaflet-routing#gh-pages",
"Leaflet.Elevation": "MrMufflon/Leaflet.Elevation#master" "Leaflet.Elevation": "MrMufflon/Leaflet.Elevation#master"
} }
} }

View file

@ -1,13 +1,13 @@
{ {
"name": "leaflet-routing", "name": "leaflet-routing",
"homepage": "https://github.com/nrenner/leaflet-routing", "homepage": "https://github.com/Turistforeningen/leaflet-routing",
"_release": "ac4d02c54b", "_release": "f78c22ed00",
"_resolution": { "_resolution": {
"type": "branch", "type": "branch",
"branch": "reroute", "branch": "gh-pages",
"commit": "ac4d02c54b06da9d1e21fe77ba5a0c553095d15e" "commit": "f78c22ed001788761b81172ef746a357a92e2f5f"
}, },
"_source": "git://github.com/nrenner/leaflet-routing.git", "_source": "git://github.com/Turistforeningen/leaflet-routing.git",
"_target": "reroute", "_target": "gh-pages",
"_originalSource": "nrenner/leaflet-routing" "_originalSource": "Turistforeningen/leaflet-routing"
} }

View file

@ -41,7 +41,7 @@ routing.snapping(true);
### Recalculate the complete route by routing each segment ### Recalculate the complete route by routing each segment
```javascript ```javascript
routing.routeAllSegments(callback); routing.rerouteAllSegments(callback);
``` ```
### Get first waypoint ### Get first waypoint

View file

@ -306,7 +306,7 @@ L.Routing = L.Control.extend({
* *
* @todo add propper error checking for callback * @todo add propper error checking for callback
*/ */
,routeAllSegments: function(cb) { ,rerouteAllSegments: function(cb) {
var numSegments = this.getWaypoints().length - 1; var numSegments = this.getWaypoints().length - 1;
var callbackCount = 0; var callbackCount = 0;
var $this = this; var $this = this;
@ -314,14 +314,14 @@ L.Routing = L.Control.extend({
var callback = function(err, data) { var callback = function(err, data) {
callbackCount++; callbackCount++;
if (callbackCount >= numSegments) { if (callbackCount >= numSegments) {
$this.fire('routing:routeAllSegmentsEnd'); $this.fire('routing:rerouteAllSegmentsEnd');
if (cb) { if (cb) {
cb(err); cb(err);
} }
} }
}; };
$this.fire('routing:routeAllSegmentsStart'); $this.fire('routing:rerouteAllSegmentsStart');
if (numSegments < 1) { if (numSegments < 1) {
return callback(null, true); return callback(null, true);

View file

@ -76,7 +76,7 @@
function updateRoute(evt) { function updateRoute(evt) {
router.setOptions(evt.options); router.setOptions(evt.options);
routing.routeAllSegments(onUpdate); routing.rerouteAllSegments(onUpdate);
} }
routingOptions = new BR.RoutingOptions(); routingOptions = new BR.RoutingOptions();