How to use Leaflet Directions API with routeType = bicycle

2 posts / 0 new
Last post
ecolibro
How to use Leaflet Directions API with routeType = bicycle

Hi there,

i´m using the leaflet plugin directions API and want to generate routings for bike. I tried it this way:

dir.route({
locations: [
{ latLng: { lat: #{reportBean.coworker.lat_home}, lng: #{reportBean.coworker.lon_home} }},
{ latLng: { lat: #{reportBean.coworker.lat_department}7, lng: #{reportBean.coworker.lon_department} }}
],
options: { routeType: ['bicycle'] }
});

But it´s apparently the wrong syntax to apply the routeType parameter. Has anybody used it successfully? 

Thanks in advance

O.Martin


MQBrianCoakley
The routeType parameter only
The routeType parameter only takes one value so remove the square brackets and you should be good to go.