mapbox / mapbox/mapbox-gl-directions

Displaying waypoints as they are in google maps

Open
#230 7 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged enhancement
Dominant language
JavaScript
Stars
255
Forks
130
PR merge metrics
No merged PRs in 30d

Description

![image](https://user-images.githubusercontent.com/54099764/67866379-4b39c000-fb42-11e9-9a51-ad823048dd4e.png)
I am setting the waypoints. They are applied but not displayed as it is on the google map (point B). Does mapbox support displaying waypoints? And if it does, then how is it possible?

I also tried changing style objects: `directions-waypoint-point` and `directions-waypoint-point-casing`, but useless.

Implementation:
```
this.map = new mapboxgl.Map({container: 'map'});
this.map.on('load', () => {
const directions = new MapboxDirections({
accessToken: this.accessToken,
unit: 'metric',
profile: 'mapbox/driving',
flyTo: false,
controls: {
inputs: false,
instructions: false,
profileSwitcher: false
}
});
directions.setOrigin([this.startLng, this.startLat]);
directions.removeWaypoint(0);
if (this.wayPoints && this.wayPoints.length) {
this.wayPoints.forEach((w, i) => {
directions.addWaypoint(i, [w.lon, w.lat]);
});
}
directions.setDestination([this.endLng, this.endLat]);
this.map.addControl(directions);
});
```

Request:
```https://api.mapbox.com/directions/v5/mapbox/driving/44.827095%2C41.715137%3B44.108409882%2C41.985412598%3B41.636745%2C41.616756.json?steps=true&overview=full&geometries=polyline&access_token=```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported route with MapboxDirections using the shown setOrigin, addWaypoint, and setDestination calls, then inspect the directions-waypoint-point and directions-waypoint-point-casing styles. Compare the rendered waypoints with the supplied Google Maps image and the Directions API request. Done means documenting or implementing a supported way to display the waypoints as requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.