Skip to content

Commit 575c9f6

Browse files
feat(routing): add possibility to display addresses instead of coordinates for waypoints
1 parent d5a67eb commit 575c9f6

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/plugins/routing/components/RoutingInput.ce.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</label>
77
<input
88
:id="`polar-plugin-routing-input-${index}`"
9-
v-model="route[index]"
9+
v-model="routeInput[index]"
1010
class="kern-form-input__input"
1111
:aria-label="
1212
$t(($) => $.label.aria, {
@@ -57,7 +57,7 @@ defineProps<{
5757
5858
const routeStore = useRoutingStore()
5959
60-
const { currentlyFocusedInput, route } = storeToRefs(routeStore)
60+
const { currentlyFocusedInput, route, routeAddressTexts} = storeToRefs(routeStore)
6161
6262
/**
6363
* This makes sure that there are always two fillable input fields at max.
@@ -68,6 +68,13 @@ const addWaypointButtonDisabled = computed(
6868
route.value.length - 1
6969
)
7070
71+
const routeInput = computed(() =>
72+
route.value.map((coord, i) => {
73+
const label = routeAddressTexts.value[i]
74+
return label?.length ? label : coord.join(', ')
75+
})
76+
)
77+
7178
function getRouteLabel(index: number) {
7279
return index === 0
7380
? 'start'

0 commit comments

Comments
 (0)