mapbox / mapbox-directions.js

Leaflet plugin for the Mapbox Directions API
https://www.mapbox.com/mapbox.js/example/v1.0.0/mapbox-directions/
ISC License
60 stars 23 forks source link

Directions example weird behavior #51

Open samanpwbb opened 10 years ago

samanpwbb commented 10 years ago

Clearing start or beginning values from directions examples removes geometries from the map but doesn't clear the directions sidebar. This leaves user is a weird state where they can interact with the sidebar, see a marker on the map hover, but without a visible route.

This feels wrong. I would clear the sidebar when one of the values gets cleared.

samanpwbb commented 10 years ago

In addition, the empty sidebar in default state is weird/confusing: screen shot 2014-09-17 at 2 39 14 pm

samanpwbb commented 10 years ago

@jfirebaugh do you know off hand what changed that would haves caused these issues? Looking at the history quick I don't spot any obvious culprit. I can look into this when I get a chance.

jfirebaugh commented 10 years ago

The mapbox.js example doesn't contain all the code from the original mapbox-directions.js example. In particular the code that adds an .active class to the sidebar and the CSS to show/hide it.

samanpwbb commented 10 years ago

I would do one of two things here to make this example better:

  1. Bring in more functionality, like was originally in place.
  2. Go the opposite direction and move instructions sidebar into separate container, strip out styling, optimize it a bit more for inheriting user-defined styles and behaviors.

It's got one foot in both options right now in an awkward way.

DennisOSRM commented 9 years ago

@samanpwbb what's less effort? The current situation does not represent our directions API well.

samanpwbb commented 9 years ago

@DennisOSRM if you want a better demo, https://www.mapbox.com/mapbox-directions.js/?route=-122.4874,37.7867;-122.4464,37.7720#13/-122.4601/37.7736 is up and running.