From 06e9ea66d6156a8dbb0051335580084daddfc2b6 Mon Sep 17 00:00:00 2001 From: Anders Mogensen Date: Thu, 12 Sep 2024 13:24:33 +0200 Subject: [PATCH 1/2] fix: wait for setRoute to resolve before setting the step index. The setRoute method recently became asynchronous, meaning that the step index would be reset to -1 just before resolving. --- .../map-template/src/components/Directions/Directions.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/map-template/src/components/Directions/Directions.jsx b/packages/map-template/src/components/Directions/Directions.jsx index da1d34085..578182f02 100644 --- a/packages/map-template/src/components/Directions/Directions.jsx +++ b/packages/map-template/src/components/Directions/Directions.jsx @@ -93,10 +93,10 @@ function Directions({ isOpen, onBack, onSetSize, snapPointSwiped, onRouteFinishe } }); - directionsRenderer.setRoute(directions.directionsResult); - - // Set the step index to be 0 in order to display the correct instruction on the map. - directionsRenderer.setStepIndex(0); + directionsRenderer.setRoute(directions.directionsResult).then(() => { + // Set the step index to be 0 in order to display the correct instruction on the map. + directionsRenderer.setStepIndex(0); + }); destinationInfoElement.current.location = directions.destinationLocation; From 27159a6ee6b1db0ea2e1f962d4cc842f0fcfcc3a Mon Sep 17 00:00:00 2001 From: Anders Mogensen Date: Thu, 12 Sep 2024 13:53:13 +0200 Subject: [PATCH 2/2] docs: changelog for release. --- packages/map-template/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/map-template/CHANGELOG.md b/packages/map-template/CHANGELOG.md index 1bc8c1d02..8064b4814 100644 --- a/packages/map-template/CHANGELOG.md +++ b/packages/map-template/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.54.7] - 2024-09-12 + +### Fixed + +- Fix bug where wayfinding steps were misaligned. + ## [1.54.6] - 2024-09-03 ### Fixed