Skip to content

Commit

Permalink
feat: update routeMap poi to have position + update poiDeck to be mor…
Browse files Browse the repository at this point in the history
…e generic
  • Loading branch information
joselegitan committed Nov 29, 2023
1 parent efe4adb commit e64012e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/PoisCard/PoiCardLight.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
:picto="icon"
size="lg"
:image="undefined"
:text="position"
:text="poi.properties.position"
/>
{{ name }}
</h3>
Expand Down
3 changes: 1 addition & 2 deletions components/PoisCard/PoisDeck.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
<div class="tw-flex tw-justify-between tw-flex-wrap tw-gap-6">
<component
:is="poisCard"
v-for="(item, index) in pois"
v-for="item in pois"
:key="item.properties.metadata.id"
:poi="item"
:position="(index + 1).toString()"
:class="[
'tw-grow-1 poi-deck',
!isFavorite(item.properties.metadata.id) &&
Expand Down
5 changes: 3 additions & 2 deletions components/PoisDetails/Route/RouteMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ export default defineNuxtComponent({
},
created() {
this.routeCollection = this.route.features.map((feature) => {
this.routeCollection = this.route.features.map((feature, index) => {
if (feature.properties['route:point:type']) {
const mapPoi = apiRouteWaypointToApiPoi(
feature as ApiRouteWaypoint,
this.colorFill,
this.colorLine
this.colorLine,
(index + 1).toString()
)
this.points.push(mapPoi)
return mapPoi
Expand Down
4 changes: 3 additions & 1 deletion lib/apiPoiDeps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ export const iconMap: { [key: string]: string } = {
export function apiRouteWaypointToApiPoi(
waypoint: ApiRouteWaypoint,
colorFill: string,
colorLine: string
colorLine: string,
position?: string
): ApiPoi {
return {
...waypoint,
Expand All @@ -79,6 +80,7 @@ export function apiRouteWaypointToApiPoi(
color_fill: colorFill,
color_line: colorLine,
},
position,
editorial: {
popup_fields: [
{
Expand Down

0 comments on commit e64012e

Please sign in to comment.