The Mappls Driving Range Plugin allows you to plot driving range area to drive based on time or distance on Mappls vector map component.
- Add below dependency in your app-level build.gradle
MapplsDrivingRangePlugin mapplsDrivingRangePlugin = new MapplsDrivingRangePlugin(mapView, mapplsMap);
Plot Driving Range
A function drawDrivingRange
of instance of MapplsDrivingRangePlugin
will be used to get driving range and plot on map. This function will accept an instance of MapplsDrivingRangeOption
as request to get driving range.
To know more visit here : mappls-android-sdk/docs/v1.0.7/Driving-Range-Plugin.md at main · mappls-api/mappls-android-sdk · GitHub
MapplsDrivingRangeContour rangeContour = MapplsDrivingRangeContour.builder()
.value(50)
.color("ff0000")
.build();
List<MapplsDrivingRangeContour> list = new ArrayList<>();
list.add(rangeContour);
MapplsDrivingRangeOption option = MapplsDrivingRangeOption.builder()
.location(location)
.rangeTypeInfo(
MapplsDrivingRangeTypeInfo.builder()
.rangeType(DrivingRangeCriteria.RANGE_TYPE_TIME)
.contours(list)
.build()
).build();
mapplsDrivingRangePlugin.drawDrivingRange(option)
//Or with callback
mapplsDrivingRangePlugin.drawDrivingRange(option, new IDrivingRangeListener() {
@Override
public void onSuccess() {
//Success
}
@Override
public void onFailure(int code, @NonNull String message) {
// Failure
}
});