hugohabicht01 / PetrolStationApp

Webapp that displays real time petrol prices of petrol stations in Germany
1 stars 1 forks source link

Fixed directions renderer, now using vanilla event listeners instead of vue bus #22

Closed hugohabicht01 closed 3 years ago

hugohabicht01 commented 3 years ago

Using vue event bus didn't work due to the ref to the map not being available inside mounted. Tried tons of different things to resolve this issue, ended up using normal js event listeners that listen for a custom event. These now allow for directions to be rendered by dispatching a 'setup-directions' event followed by a 'render-directions' event. The latter has two arguments, start and end.