Skip to content

Commit

Permalink
Version 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hdelva authored Jan 24, 2020
2 parents 7cad989 + de663c0 commit 3e46d40
Show file tree
Hide file tree
Showing 82 changed files with 8,580 additions and 6,377 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,24 @@ Include it in the browser:
...

<script>
const { BasicTrainPlanner, Units } = PlannerJS;
const { FlexibleTransitPlanner, Units } = PlannerJS;
</script>
```

Include it in your JavaScript project:
```javascript
const { BasicTrainPlanner, Units } = require('plannerjs');
const { FlexibleTransitPlanner, Units } = require('plannerjs');

// or

import { BasicTrainPlanner, Units } from 'plannerjs';
import { FlexibleTransitPlanner, Units } from 'plannerjs';
```

Use it in both environments:
```javascript
const planner = new BasicTrainPlanner();
const planner = new FlexibleTransitPlanner();
planner.addConnectionSource("https://graph.irail.be/sncb/connections");
planner.addStopSource("https://irail.be/stations/NMBS");

planner.query({
from: "http://irail.be/stations/NMBS/008812005", // Brussels North
Expand Down
4 changes: 3 additions & 1 deletion docs/js/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ L.tileLayer(
}
).addTo(map);

const planner = new PlannerJS.DelijnNmbsPlanner();
const planner = new PlannerJS.FlexibleTransitPlanner();
planner.addConnectionSource("https://graph.irail.be/sncb/connections");
planner.addStopSource("https://irail.be/stations/NMBS");

planner.prefetchStops();
planner.prefetchConnections(new Date(), new Date(new Date().getTime() + 2 * 60 * 60 * 1000));
Expand Down
Loading

0 comments on commit 3e46d40

Please sign in to comment.