Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/amenity routing #133

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Feat/amenity routing #133

wants to merge 4 commits into from

Conversation

sandriches
Copy link
Contributor

Adds amenity based routing example.

# Add amenities to your route

I need coffee! The kids need a bathroom break! Feed me or I'll end it all! Common complaints heard whilst driving. With amenity-based-routing, your caffeine/bathroom/food/other needs can be catered too, all whilst you charge your vehicle.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I loved this but I would make this a bit less extreme and more focus on a lunch stop.


## Steps to take

1. Plotting a route starts by executing the `newRoute` mutation. This mutation requires information about the car, origin and destination. After the mutation is finished executing a route `id` will be returned. Here the amenity preferences for the route should be added.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets change car to vehicle

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the newRoute mutation you can also add additional requirements such as a scheduled amenity stop.


/**
* Example application of how to build a route with the Chargetrip API.
* Please have a look to Readme file in this repo for more details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how to build a route with a scheduled amen city stop

*/
const headers = {
//Replace this x-client-id and app-id with your own to get access to more cars
'x-client-id': '5ed1175bad06853b3aa1e492',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vehicles and the complete station database


/**
* This project shows you how to fetch a car list and render the car details
* The project structure contains;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This project shows you how create a route with a scheduled amenity stop

Copy link
Contributor

@lsmienk lsmienk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I think there are a few things we can do to improve the example:

  • The plugs available in the route I get are 0. This can be because of the demo station data. I would suggest removing that line from the example.

  • We now also show all amenities which is great, but I would highlight more that this is a lunch stop.

  • The duration you chose of 2000 seconds is 33 min. This looks a bit random. I would change this to 30 min/ 45 or an hour. So it looks less like the time it takes to charge and more like a lunch stop.

  • At the top of the example you are now just highlighting the duration of trip. This is not the most important part. I would change this to From xxx to xxx. With a xx min lunch stop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants