maplibre / maplibre-gl-directions

A plugin to show routing directions on a MapLibre GL JS map
https://maplibre.org/maplibre-gl-directions/
MIT License
72 stars 16 forks source link

Bearings support and control #195

Closed smellyshovel closed 1 year ago

smellyshovel commented 1 year ago

This PR:

  1. Adds the bearings configuration option.
  2. Adds support for waypoints' bearings: public getter/setter waypointsBearings. These have no effect with disabled bearings - see i. 1.
  3. Adds a new rotatewaypoints event which is emited each time new bearings values are set using the setter from i. 1.
  4. Updates the buildRequest method to include the bearings info when making a request (when bearings is enabled).
  5. Adds new BearingsControl control.
  6. Adds an example that shows the new functionality in action.
  7. Closes #193

And 2 unrelated to this PR small changes, see below.

smellyshovel commented 1 year ago

@Miguel-Sanches please, review this PR. Tell me about anything that's missing.

Would be very nice if you could test it manually locally. Especially the Demo.