-
Notifications
You must be signed in to change notification settings - Fork 266
Description
It is suggested that adding a second members to de 'services' array in src/leaflet_options.js would trigger the creation of a 'select-provider' select element in the UI, allow the runtime switch of backends. This behaviour is currently implemenetd on the demo site at https://map.project-osrm.org/
Adding a secong memeber hower does NOT trigger the creation of such a dropdown menu. See example here
module.exports = {
defaultState: {
center: L.latLng(38.8995,-77.0269),
zoom: 13,
waypoints: [],
language: 'en',
alternative: 0,
layer: streets
},
services: [{
label: 'Car (fastest)',
path: 'https://router.project-osrm.org/route/v1'
},
{
label: 'Bike (slowest)', // whatever you want to call it
path: 'https://api.openrouteservice.org/directions/bicycle-urban' // example URL
}],
layer: [{
'Mapbox Streets': streets,
'Mapbox Outdoors': outdoors,
'Mapbox Streets Satellite': satellite,
'openstreetmap.org': osm,
'openstreetmap.de.org': osm_de
}],
overlay: {
'Hiking': hiking,
'Bike': bike,
'Small Components': small_components
},
baselayer: {
one: streets,
two: outdoors,
three: satellite,
four: osm,
five: osm_de
}
};