The following are the additional parameters for search along the route in direction plugin for android sdk :
searchAlongRoute(Boolean) : An easy, ready to use UI has been introduced to search pois Along the route with default categories list.Default is true.
To access this parameter , please contact API Support This parameter takes the encoded route along which POIs will be searched.
For more information visit here : mappls-android-sdk/docs/v1.0.7/Direction-Widget.md at main · mappls-api/mappls-android-sdk · GitHub
This parameter is further having configurable options listed below.
alongRouteBuffer (Integer) : 200, [ Buffer of the road. Minimum value is 25m, maximum is 1000m and default is 25m]
CategoryCode: This class is used to set the information for the poi categories to show in Widget. It contains the following properties in constructor:
- category (String): Name of the category that display on a view
- icon(Integer): To show icon of category
- categoryCode (List): List of category codes
- markerIcon (Integer): Marker icon to display on a map
- isSelected (Boolean): To set the category is selected or not.
List<CategoryCode> categoryCodes = new ArrayList<>();
List<String> coffeeCatgories = new ArrayList<>();
coffeeCatgories.add("FODCOF");
categoryCodes.add(new CategoryCode("Coffee", R.drawable.icon_coffee,coffeeCatgories, R.drawable.ic_map_coffee));
DirectionOptions directionOptions = DirectionOptions.builder()
.alongRouteBuffer(300)
.searchAlongRoute(true)
.build();
directionFragment = DirectionFragment.newInstance(directionOptions);
directionFragment.setCategoryCodes(categoryCodes);
addFragment(R.id.container, directionFragment, false, false);
- To pass the MapView
directionFragment.provideMap(MapView)
Callbacks getting from Direction Fagment
Implement from DirectionCallback interface:
directionFragment.setDirectionCallback(new DirectionCallback() {
@Override
public void onCancel() {
//on Click of back button
}
@Override
public void onStartNavigation(DirectionPoint origin, DirectionPoint destination, List<DirectionPoint> waypoints, DirectionsResponse directionsResponse, int selectedIndex) {
//Get the origin, destination, waypoints, directionsResponse and the selected Index
}
});