Directions Service
Android v4
val directionsService = MPDirectionsService()
val directionsRenderer = MPDirectionsRenderer(mapControl)
val origin = MPPoint(57.057917, 9.950361, 0.0)
val destination = MPPoint(57.058038, 9.950509, 0.0)
directionsService.setRouteResultListener { route, error -> }
directionsService.query(origin, destination)MPDirectionsService directionsService = new MPDirectionsService();
MPDirectionsRenderer directionsRenderer = new MPDirectionsRenderer(mapControl);
MPPoint origin = new MPPoint(57.057917, 9.950361, 0.0);
MPPoint destination = new MPPoint(57.058038, 9.950509, 0.0);
directionsService.setRouteResultListener((route, error) -> {
});
directionsService.query(origin, destination);val directionsRenderer = MPDirectionsRenderer(mapControl)
directionsRenderer.setPolylineColors(Color.GREEN, Color.BLACK)MPDirectionsRenderer directionsRenderer = MPDirectionsRenderer(mapControl);
directionsRenderer.setPolylineColors(Color.GREEN, Color.BLACK);Change Transportation Mode
fun createRoute(mpLocation: MPLocation) {
// if MPDirectionsService has not been instantiated create it here and assign the results call back to the activity.
if (mpDirectionsService == null) {
mpDirectionsService = MPDirectionsService()
mpDirectionsService?.setRouteResultListener(this::onRouteResult)
}
mpDirectionsService?.setTravelMode(MPTravelMode.WALKING)
// queries the MPDirectionsService for a route with the hardcoded user location and the point from a location.
mpDirectionsService?.query(mUserLocation, mpLocation.point)
}void createRoute(MPLocation mpLocation) {
// if MPDirectionsService has not been instantiated create it here and assign the results call back to the activity.
if (mpDirectionsService == null) {
mpDirectionsService = new MPDirectionsService();
mpDirectionsService.setRouteResultListener(this::onRouteResult);
}
mpDirectionsService.setTravelMode(MPTravelMode.WALKING);
// queries the MPDirectionsService for a route with the hardcoded user location and the point from a location.
mpDirectionsService.query(mUserLocation, mpLocation.getPoint());
}Route Restrictions
Avoid and exclude way types
App User Role Restrictions
Transit Departure and Arrival Time
Last updated
Was this helpful?