diff options
Diffstat (limited to 'src/here/here_route.cpp')
-rwxr-xr-x | src/here/here_route.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/here/here_route.cpp b/src/here/here_route.cpp index 58cb5fe..aa1abfb 100755 --- a/src/here/here_route.cpp +++ b/src/here/here_route.cpp @@ -42,7 +42,7 @@ here_error_e HereRoute::PrepareQuery() return HERE_ERROR_PERMISSION_DENIED; GeoCoordinates origCoord, destCoord; - m_pQuery = new GeoRouteQuery(origCoord, destCoord); + m_pQuery = new (std::nothrow) GeoRouteQuery(origCoord, destCoord); if (!m_pQuery) return HERE_ERROR_OUT_OF_MEMORY; @@ -211,7 +211,7 @@ void HereRoute::OnRouteReply(const GeoRouteReply& Reply) if (nReplyNum == 0) { ((maps_service_search_route_cb)m_pCbFunc)(MAPS_ERROR_NOT_FOUND, m_nReqId, - 0, 1, NULL, m_pUserData); + 0, 0, NULL, m_pUserData); delete this; return; } @@ -305,6 +305,12 @@ void HereRoute::OnRouteReply(const GeoRouteReply& Reply) delete this; } +void HereRoute::OnRouteFailure(const GeoRouteReply& Reply) +{ + if (!m_bCanceled) + ((maps_service_search_route_cb)m_pCbFunc)((maps_error_e)GetErrorCode(Reply), m_nReqId, 0, 0, NULL, m_pUserData); + delete this; +} maps_error_e HereRoute::ProcessSegments(maps_route_h mapsRoute, const RouteSegmentList& hereSegmList) { |