summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/leaflet-soton.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js
index 98a4f09..3cbb300 100644
--- a/src/leaflet-soton.js
+++ b/src/leaflet-soton.js
@@ -470,7 +470,7 @@ SELECT * WHERE {\
layer.addData(data[layerName]);
}
- if (options.busRoutes) {
+ if ("Route" in L) {
var routeLayer = new L.Route(options.busRoutes ? data.busRoutes : emptyFeatureCollection, data.busStops, {
routeOptions: {
onEachFeature: function(feature, layer) {
@@ -494,7 +494,7 @@ SELECT * WHERE {\
});
routeLayer.addTo(map);
- if (options.busRouteControl) {
+ if (options.busRoutes && options.busRouteControl) {
var routeControl = new L.Control.Route(routeLayer, "sidebar", {
routeMasterSort: function(a, b) {
var refs = {