-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
80 lines (77 loc) · 2.47 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
var L = require('leaflet'),
Control = require('./control'),
Itinerary = require('./itinerary'),
Line = require('./line'),
OSRMv1 = require('./osrm-v1'),
Plan = require('./plan'),
Waypoint = require('./waypoint'),
Autocomplete = require('./autocomplete'),
Formatter = require('./formatter'),
GeocoderElement = require('./geocoder-element'),
Localization = require('./localization'),
ItineraryBuilder = require('./itinerary-builder'),
Mapbox = require('./mapbox'),
ErrorControl = require('./error-control');
L.routing = {
control: function(options) { return new Control(options); },
itinerary: function(options) {
return Itinerary(options);
},
line: function(route, options) {
return new Line(route, options);
},
plan: function(waypoints, options) {
return new Plan(waypoints, options);
},
waypoint: function(latLng, name, options) {
return new Waypoint(latLng, name, options);
},
osrmv1: function(options) {
return new OSRMv1(options);
},
localization: function(options) {
return new Localization(options);
},
formatter: function(options) {
return new Formatter(options);
},
geocoderElement: function(wp, i, nWps, plan) {
return new L.Routing.GeocoderElement(wp, i, nWps, plan);
},
itineraryBuilder: function(options) {
return new ItineraryBuilder(options);
},
mapbox: function(accessToken, options) {
return new Mapbox(accessToken, options);
},
errorControl: function(routingControl, options) {
return new ErrorControl(routingControl, options);
},
autocomplete: function(elem, callback, context, options) {
return new Autocomplete(elem, callback, context, options);
}
};
module.exports = L.Routing = {
Control: Control,
Itinerary: Itinerary,
Line: Line,
OSRMv1: OSRMv1,
Plan: Plan,
Waypoint: Waypoint,
Autocomplete: Autocomplete,
Formatter: Formatter,
GeocoderElement: GeocoderElement,
Localization: Localization,
Formatter: Formatter,
ItineraryBuilder: ItineraryBuilder,
// Legacy; remove these in next major release
control: L.routing.control,
itinerary: L.routing.itinerary,
line: L.routing.line,
plan: L.routing.plan,
waypoint: L.routing.waypoint,
osrmv1: L.routing.osrmv1,
geocoderElement: L.routing.geocoderElement,
mapbox: L.routing.mapbox,
errorControl: L.routing.errorControl,
};