Skip to content

Commit

Permalink
Merge pull request #55 from openplannerteam/feature/docs-map-demo
Browse files Browse the repository at this point in the history
Add map demo to CodePen in docs #47
  • Loading branch information
maximtmartin authored Dec 21, 2018
2 parents c7df6b3 + fe167a1 commit 1037f11
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ <h1>Planner.js</h1>
</p>
<section>
<h2 id="demo">Demo</h2>
<h3>Table</h3>
<p
data-height="398"
data-theme-id="light"
Expand All @@ -39,6 +40,19 @@ <h2 id="demo">Demo</h2>
See the Pen <a href="https://codepen.io/maximtmartin/pen/bQZMoj">Using the new JavaScript route
planner</a> on <a href="https://codepen.io">CodePen</a>.
</p>
<h3>Map</h3>
<p
data-height="700"
data-theme-id="light"
data-slug-hash="yGMzLM"
data-default-tab="result"
data-user="maximtmartin"
data-pen-title="Using the new JavaScript route planner (work in progress)"
class="codepen"
>
See the Pen <a href="https://codepen.io/maximtmartin/pen/yGMzLM">Using the new JavaScript route
planner</a> on <a href="https://codepen.io">CodePen</a>.
</p>
</section>
<!--<section>
<h2 id="philosophy">Principles</h2>
Expand Down
12 changes: 12 additions & 0 deletions src/Planner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { AsyncIterator } from "asynciterator";
import { EventEmitter, Listener } from "events";
import Context from "./Context";
import EventType from "./EventType";
import IStop from "./fetcher/stops/IStop";
import IStopsProvider from "./fetcher/stops/IStopsProvider";
import IPath from "./interfaces/IPath";
import IQuery from "./interfaces/IQuery";
import defaultContainer from "./inversify.config";
Expand Down Expand Up @@ -97,4 +99,14 @@ export default class Planner implements EventEmitter {

return this;
}

public getAllStops(): Promise<IStop[]> {
const provider = this.context.getContainer().get<IStopsProvider>(TYPES.StopsProvider);

if (provider) {
return provider.getAllStops();
}

return Promise.reject();
}
}

0 comments on commit 1037f11

Please sign in to comment.