Skip to content

Commit

Permalink
fix: in table.response using osrmtype.waypoint instead of route.waypoint
Browse files Browse the repository at this point in the history
issue: #137
  • Loading branch information
CodeBear801 committed Feb 4, 2020
1 parent 8fa5111 commit e75e0b1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
9 changes: 9 additions & 0 deletions integration/pkg/api/osrm/osrmtype/waypoint.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package osrmtype

// Waypoint object used to describe waypoint used in route or table.
type Waypoint struct {
Name string `json:"name"`
Location [2]float64 `json:"location,omitempty"` // [longitude, latitude]
Distance float64 `json:"distance"`
Hint string `json:"hint"`
}
16 changes: 9 additions & 7 deletions integration/pkg/api/osrm/table/response.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package table

import "github.com/Telenav/osrm-backend/integration/pkg/api/osrm/route"
import (
"github.com/Telenav/osrm-backend/integration/pkg/api/osrm/osrmtype"
)

// Response represents OSRM api v1 table response.
type Response struct {
Code string `json:"code"`
Message string `json:"message,omitempty"`
Sources []*route.Waypoint `json:"sources"`
Destinations []*route.Waypoint `json:"destinations"`
Durations [][]*float64 `json:"durations"`
Distances [][]*float64 `json:"distances"`
Code string `json:"code"`
Message string `json:"message,omitempty"`
Sources []*osrmtype.Waypoint `json:"sources"`
Destinations []*osrmtype.Waypoint `json:"destinations"`
Durations [][]*float64 `json:"durations"`
Distances [][]*float64 `json:"distances"`
}

0 comments on commit e75e0b1

Please sign in to comment.