| 107 | } |
| 108 | |
| 109 | std::string MapboxApi::GetDirectionsURL(Params const & params) const |
| 110 | { |
| 111 | CHECK(!GetAccessToken().empty(), ()); |
| 112 | |
| 113 | std::vector<ms::LatLon> coords; |
| 114 | coords.reserve(params.m_waypoints.GetPoints().size()); |
| 115 | for (auto const & point : params.m_waypoints.GetPoints()) |
| 116 | coords.emplace_back(mercator::ToLatLon(point)); |
| 117 | |
| 118 | std::ostringstream oss; |
| 119 | oss << kBaseURL << "directions/" << kDirectionsApiVersion << "/" << VehicleTypeToMapboxType(params.m_type) << "/"; |
| 120 | oss << LatLonsToString(coords) << "?"; |
| 121 | oss << "access_token=" << GetAccessToken() << "&"; |
| 122 | oss << "overview=simplified&" |
| 123 | << "geometries=geojson"; |
| 124 | oss << "&alternatives=true"; |
| 125 | |
| 126 | return oss.str(); |
| 127 | } |
| 128 | } // namespace routing_quality::api::mapbox |
nothing calls this directly
no test coverage detected