You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I've been searching over the internet including your API references and documentation, but I can't find any resource of full usage of your package. I want to use google_maps_webservice/directions to implement in-app navigation, but I can't find a way to do it. Can you please help me to achieve that? Any help would be much appreciated. Thanks
The text was updated successfully, but these errors were encountered:
Hello @gadishimwe,
I also came across this issue and so I created a custom function to decode polyline points from the routes.
The polyline string to decode can be accessed through: route.overviewPolyline.points.
Pass the string to the following function, and it will return a list of coordinates(LatLng):
List<LatLng> decodeEncodedPolyline(String encoded) {
List<LatLng> poly = [];
int index = 0, len = encoded.length;
int lat = 0, lng = 0;
while (index < len) {
int b, shift = 0, result = 0;
do {
b = encoded.codeUnitAt(index++) - 63;
result |= (b & 0x1f) << shift;
shift += 5;
} while (b >= 0x20);
int dlat = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
lat += dlat;
shift = 0;
result = 0;
do {
b = encoded.codeUnitAt(index++) - 63;
result |= (b & 0x1f) << shift;
shift += 5;
} while (b >= 0x20);
int dlng = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
lng += dlng;
LatLng p = new LatLng((lat / 1E5).toDouble(), (lng / 1E5).toDouble());
poly.add(p);
}
return poly;
}
Thank you for your response. Unfortunately, I wasn't looking for a way to draw just the routes. I wanted to implement in-app turn-to-turn navigation and later I found out that it wasn't supported or implemented because Google want us to use their Google Maps app instead.
Hello. I've been searching over the internet including your API references and documentation, but I can't find any resource of full usage of your package. I want to use google_maps_webservice/directions to implement in-app navigation, but I can't find a way to do it. Can you please help me to achieve that? Any help would be much appreciated. Thanks
The text was updated successfully, but these errors were encountered: