public static String getFullPath(ShapePoints shapePoints,
CoordinatePoint nextPoint) {
if (nextPoint == null) {
EncodedPolylineBean bean = PolylineEncoder.createEncodings(
shapePoints.getLats(), shapePoints.getLons());
return bean.getPoints();
} else {
int n = shapePoints.getSize() + 1;
double[] lats = new double[n];
double[] lons = new double[n];
System.arraycopy(shapePoints.getLats(), 0, lats, 0, n - 1);
System.arraycopy(shapePoints.getLons(), 0, lons, 0, n - 1);
lats[n - 1] = nextPoint.getLat();
lons[n - 1] = nextPoint.getLon();
EncodedPolylineBean bean = PolylineEncoder.createEncodings(lats, lons);
return bean.getPoints();
}
}