-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(directions): improve the directions tool (#452)
* fix(direction)Now get the first coord of line/poly * fix(direction) handle search term subscription * refactor(routing) handling search result and title * refactor(direction) Coord rounded to 5 decimal * feat(direction) keep stop's title on component change. * fix(directions) Trigger and show route results on component change * refactor(direction) show coordinates as string * lint * typo * i18n(routing) Wrong language. * refactor(directions) keep stop's title on component change * refactor(directions) Stop interface
- Loading branch information
Showing
5 changed files
with
110 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 15 additions & 4 deletions
19
packages/geo/src/lib/routing/routing-form/routing-form.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,28 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { Stop } from '../shared/routing.interface'; | ||
|
||
@Injectable() | ||
export class RoutingFormService { | ||
private stopsCoordinates: [number, number][]; | ||
private stops: Stop[]; | ||
|
||
constructor() {} | ||
|
||
getStopsCoordinates(): [number, number][] { | ||
return this.stopsCoordinates; | ||
const stopsCoordinates = []; | ||
if (this.stops) { | ||
this.stops.forEach(stop => { | ||
stopsCoordinates.push(stop.stopCoordinates); | ||
}); | ||
} | ||
return stopsCoordinates; | ||
} | ||
|
||
setStopsCoordinates(stopsCoordinates) { | ||
this.stopsCoordinates = stopsCoordinates; | ||
setStops(stops: Stop[]) { | ||
this.stops = stops; | ||
} | ||
|
||
getStops() { | ||
return this.stops; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.