From dc68fe369a628e8090fae34948c6124348fad026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-=C3=89tienne=20Lord?= <7397743+pelord@users.noreply.github.com> Date: Thu, 13 Feb 2020 09:57:32 -0500 Subject: [PATCH] fix(directions): search term change and map synchronization (#580) * fix(directions) Always subscribe to term change * fix(directions) add layer to map synchronization * refactior(directions) lint --- .../directions-form.component.ts | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/packages/geo/src/lib/directions/directions-form/directions-form.component.ts b/packages/geo/src/lib/directions/directions-form/directions-form.component.ts index c10205da5..aa78e8f6f 100644 --- a/packages/geo/src/lib/directions/directions-form/directions-form.component.ts +++ b/packages/geo/src/lib/directions/directions-form/directions-form.component.ts @@ -127,21 +127,12 @@ export class DirectionsFormComponent implements OnInit, OnDestroy { ]) }); - if (!this.directionsFormService.getStops()) { - this.map.status$.pipe(take(1)).subscribe(() => { - this.conditionalInit(); - }); - } else { - this.conditionalInit(); - } - - } + setTimeout(() => { + this.initStores(); + this.initOlInteraction(); + }, 1); - private conditionalInit() { - this.initStores(); - this.initOlInteraction(); this.subscribeToFormChange(); - this.routesQueries$$.push( this.stream$ .pipe(