Skip to content

Commit

Permalink
feat: Add arrow symbol to polyline in RouteMap component
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmedhossamdev committed Aug 22, 2024
1 parent f16738a commit b117093
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/components/map/RouteMap.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
if (shape) {
polyline = await createPolyline(shape);
addArrowToPolyline();
polyline.setMap(map);
}
}
Expand All @@ -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 },
Expand Down

0 comments on commit b117093

Please sign in to comment.