Address PR comments

This commit is contained in:
Patrick Niklaus
2015-12-08 03:16:07 +01:00
parent f2ee0aad20
commit 20c45be3b3
6 changed files with 120 additions and 99 deletions
+9 -4
View File
@@ -36,7 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
RouteParameters::RouteParameters()
: zoom_level(18), print_instructions(false), alternate_route(true), geometry(true),
compression(true), deprecatedAPI(false), uturn_default(false), classify(false), mapped_points(true),
compression(true), deprecatedAPI(false), uturn_default(false), classify(false),
matching_beta(5), gps_precision(5), check_sum(-1), num_results(1)
{
}
@@ -146,22 +146,28 @@ void RouteParameters::addCoordinate(
coordinates.emplace_back(
static_cast<int>(COORDINATE_PRECISION * boost::fusion::at_c<0>(received_coordinates)),
static_cast<int>(COORDINATE_PRECISION * boost::fusion::at_c<1>(received_coordinates)));
is_source.emplace_back(true);
is_destination.emplace_back(true);
}
void RouteParameters::addDestination(
const boost::fusion::vector<double, double> &received_coordinates)
{
destinations.emplace_back(
coordinates.emplace_back(
static_cast<int>(COORDINATE_PRECISION * boost::fusion::at_c<0>(received_coordinates)),
static_cast<int>(COORDINATE_PRECISION * boost::fusion::at_c<1>(received_coordinates)));
is_source.emplace_back(false);
is_destination.emplace_back(true);
}
void RouteParameters::addSource(
const boost::fusion::vector<double, double> &received_coordinates)
{
sources.emplace_back(
coordinates.emplace_back(
static_cast<int>(COORDINATE_PRECISION * boost::fusion::at_c<0>(received_coordinates)),
static_cast<int>(COORDINATE_PRECISION * boost::fusion::at_c<1>(received_coordinates)));
is_source.emplace_back(true);
is_destination.emplace_back(false);
}
void RouteParameters::getCoordinatesFromGeometry(const std::string &geometry_string)
@@ -170,4 +176,3 @@ void RouteParameters::getCoordinatesFromGeometry(const std::string &geometry_str
coordinates = pc.decode_string(geometry_string);
}
void RouteParameters::setMappedPointsFlag(const bool flag) { mapped_points = flag; }