I am trying to use Google Roads api, in which want to call a method snapToRoads
, but I am facing an issue.
I tried to use other method of snapToRoads
, but it also shows same error
LatLng[] page = latLngs
.subList(lowerBound, upperBound)
.toArray(new LatLng[upperBound - lowerBound]);
SnappedPoint[] points = RoadsApi.snapToRoads(context, true, page).await();
RoadsApi.snapToRoads(context, true, page)
shows... "Cannot resolve method snapToRoads(..,...,...)'"
I believe i have added the necessary dependencies in app level gradle :
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.maps:google-maps-services:0.9.3'
implementation 'com.google.maps.android:android-maps-utils:0.5'
If there is any other dependency which i have not added then please let me know.
Import statements have also been added in my Activity:
import com.google.maps.GeoApiContext;
import com.google.maps.RoadsApi;
import com.google.maps.model.SnappedPoint;
Link which i have referred to: roads-api-samples