switch to reroute branch until merged
This commit is contained in:
parent
75051d7d6c
commit
7b72ae7d20
4 changed files with 50 additions and 8 deletions
|
|
@ -11,6 +11,6 @@
|
||||||
"leaflet-gpx": "mpetazzoni/leaflet-gpx",
|
"leaflet-gpx": "mpetazzoni/leaflet-gpx",
|
||||||
"leaflet-search": "*",
|
"leaflet-search": "*",
|
||||||
"leaflet-plugins": "*",
|
"leaflet-plugins": "*",
|
||||||
"leaflet-routing": "Turistforeningen/leaflet-routing#gh-pages"
|
"leaflet-routing": "nrenner/leaflet-routing#reroute"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
14
bower_components/leaflet-routing/.bower.json
vendored
14
bower_components/leaflet-routing/.bower.json
vendored
|
|
@ -1,13 +1,13 @@
|
||||||
{
|
{
|
||||||
"name": "leaflet-routing",
|
"name": "leaflet-routing",
|
||||||
"homepage": "https://github.com/Turistforeningen/leaflet-routing",
|
"homepage": "https://github.com/nrenner/leaflet-routing",
|
||||||
"_release": "9d66697f2a",
|
"_release": "ac4d02c54b",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "branch",
|
"type": "branch",
|
||||||
"branch": "gh-pages",
|
"branch": "reroute",
|
||||||
"commit": "9d66697f2a0e547b61a48c7a5358f5f0bba280fe"
|
"commit": "ac4d02c54b06da9d1e21fe77ba5a0c553095d15e"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/Turistforeningen/leaflet-routing.git",
|
"_source": "git://github.com/nrenner/leaflet-routing.git",
|
||||||
"_target": "gh-pages",
|
"_target": "reroute",
|
||||||
"_originalSource": "Turistforeningen/leaflet-routing"
|
"_originalSource": "nrenner/leaflet-routing"
|
||||||
}
|
}
|
||||||
5
bower_components/leaflet-routing/README.md
vendored
5
bower_components/leaflet-routing/README.md
vendored
|
|
@ -39,6 +39,11 @@ routing.routing(true);
|
||||||
routing.snapping(true);
|
routing.snapping(true);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Recalculate the complete route by routing each segment
|
||||||
|
```javascript
|
||||||
|
routing.routeAllSegments(callback);
|
||||||
|
```
|
||||||
|
|
||||||
### Get first waypoint
|
### Get first waypoint
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
|
|
||||||
|
|
@ -295,6 +295,43 @@ L.Routing = L.Control.extend({
|
||||||
this._routeSegment(marker, marker._routing.nextMarker, callback);
|
this._routeSegment(marker, marker._routing.nextMarker, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recalculate the complete route by routing each segment
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
*
|
||||||
|
* @param <Function> cb - callback function
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @todo add propper error checking for callback
|
||||||
|
*/
|
||||||
|
,routeAllSegments: function(cb) {
|
||||||
|
var numSegments = this.getWaypoints().length - 1;
|
||||||
|
var callbackCount = 0;
|
||||||
|
var $this = this;
|
||||||
|
|
||||||
|
var callback = function(err, data) {
|
||||||
|
callbackCount++;
|
||||||
|
if (callbackCount >= numSegments) {
|
||||||
|
$this.fire('routing:routeAllSegmentsEnd');
|
||||||
|
if (cb) {
|
||||||
|
cb(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$this.fire('routing:routeAllSegmentsStart');
|
||||||
|
|
||||||
|
if (numSegments < 1) {
|
||||||
|
return callback(null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
this._eachSegment(function(m1, m2) {
|
||||||
|
this._routeSegment(m1, m2, callback);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Route segment between two markers
|
* Route segment between two markers
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue