Skip to content

Setting more than one backend in src/leaflet_options.js does not create dropdown menu to choose #388

@triplemutex

Description

@triplemutex

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
}
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions