Skip to content

Routing using LatLong #115

Open
Open
@ghost

Description

Example code:
LatLong from = new LatLong(60.1625332, 24.935426);
LatLong to = new LatLong( 60.1633472, 24.9202176);
DirectionsRequest request = new DirectionsRequest(from, to, TravelModes.DRIVING);

Does not function. The routing result points to the other end of the world without any route.
I was able to correct it here by changing

DirectionsRequest:convertToJavascriptString(...)
lines:
builder.append("origin: '").append(latLongOrigin.getVariableName()).append("'");
-->
builder.append("origin: '").append(latLongOrigin.toString()).append("'");

builder.append("destination: '").append(latLongDestination.getVariableName()).append("'");
-->
builder.append("destination: '").append(latLongDestination.toString()).append("'");

And modifying the LatLong:toString to:
public String toString() {
return getLatitude() + "," + getLongitude();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions