2

I am going through the MapQuest.js documentation and essentially i'd like to omit the option for automobiles and replace it with a bicycle.

var map = L.mapquest.map('map', {
      center: this.state.center,
      layers: L.mapquest.tileLayer(this.state.baseLayer),
      zoom: this.state.zoom,
      zoomControl: false,
    });
    L.mapquest
      .directionsControl({
        className: 'control-panel',
        routeSummary: {
          enabled: false,
        },
        narrativeControl: {
          enabled: true,
          compactResults: false,
        }
      })
      .addTo(map);
    L.control.zoom({ position: 'topright' }).addTo(map);
  }

enter image description here

I came across this info under MapQuest.js > API Reference > mapquest.directions.route.

A class that acts as an interface to the MapQuest Directions API. Performs either a Route, Optimized Route, or Alternate Route call depending on the routeOptions. If no callback is provided, the route will be automatically rendered on the map. The route markers and ribbons can be styled using the setLayerOptions function. If a callback is provided, the results of the API call will be passed in the error-first callback style.

Can someone show me how I would be able to leverage some of the options in the Directions API? Am I correct in my thinking this is how you would go about really customizing things?

Antonio Pavicevac-Ortiz
  • 7,239
  • 17
  • 68
  • 141

0 Answers0