MCPcopy Create free account
hub / github.com/comaps/comaps / GetDirectionsURL

Method GetDirectionsURL

libs/routing/routing_quality/api/mapbox/mapbox_api.cpp:109–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109std::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

Callers

nothing calls this directly

Calls 7

VehicleTypeToMapboxTypeFunction · 0.85
LatLonsToStringFunction · 0.85
ToLatLonFunction · 0.50
emptyMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected