From b117093aff924add46f979aea9a549cbe3145dcb Mon Sep 17 00:00:00 2001 From: Ahmedhossamdev Date: Fri, 23 Aug 2024 02:18:29 +0300 Subject: [PATCH 1/7] feat: Add arrow symbol to polyline in RouteMap component --- src/components/map/RouteMap.svelte | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/components/map/RouteMap.svelte b/src/components/map/RouteMap.svelte index 24921ae..e2c922f 100644 --- a/src/components/map/RouteMap.svelte +++ b/src/components/map/RouteMap.svelte @@ -39,6 +39,7 @@ if (shape) { polyline = await createPolyline(shape); + addArrowToPolyline(); polyline.setMap(map); } } @@ -54,6 +55,25 @@ } } + function addArrowToPolyline() { + const arrowSymbol = { + path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW, + scale: 2, + strokeColor: '#FF0000', + strokeWeight: 3 + }; + + polyline.setOptions({ + icons: [ + { + icon: arrowSymbol, + offset: '100%', + repeat: '50px' + } + ] + }); + } + function addStopMarker(stopTime, stop) { const marker = new google.maps.Marker({ position: { lat: stop.lat, lng: stop.lon }, From 3a6be19290746b9ad6584b3b3998d0232d24c7da Mon Sep 17 00:00:00 2001 From: Ahmedhossamdev Date: Fri, 23 Aug 2024 02:18:34 +0300 Subject: [PATCH 2/7] refactor: Remove unnecessary console.log statement in +server.js --- src/routes/api/oba/shape/[shapeId]/+server.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/routes/api/oba/shape/[shapeId]/+server.js b/src/routes/api/oba/shape/[shapeId]/+server.js index 7569916..8eb0596 100644 --- a/src/routes/api/oba/shape/[shapeId]/+server.js +++ b/src/routes/api/oba/shape/[shapeId]/+server.js @@ -9,7 +9,6 @@ export async function GET({ params }) { try { const response = await fetch(apiURL); - console.log('response:', response); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); From 59b7e16f81df1a0834098472fa4f5e5029a15199 Mon Sep 17 00:00:00 2001 From: Ahmedhossamdev Date: Fri, 23 Aug 2024 12:26:12 +0300 Subject: [PATCH 3/7] refactor: removed addArrowToPolyline function --- src/components/map/RouteMap.svelte | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/components/map/RouteMap.svelte b/src/components/map/RouteMap.svelte index e2c922f..a031510 100644 --- a/src/components/map/RouteMap.svelte +++ b/src/components/map/RouteMap.svelte @@ -1,7 +1,7 @@