resolvePath static method

List<LatLng> resolvePath(
  1. EncodedPathModel encodedPathModel
)

Decodes the route inside encodedPathModel back into a coordinate list.

Implementation

static List<LatLng> resolvePath(EncodedPathModel encodedPathModel) {
  if (encodedPathModel.encodedPath.isEmpty) {
    return List<LatLng>.from(encodedPathModel.pathModel.path);
  }

  final decoded = decodePolyline(
    encodedPathModel.encodedPath,
    precision: encodedPathModel.polylinePrecision,
  );

  return decoded.isEmpty
      ? List<LatLng>.from(encodedPathModel.pathModel.path)
      : decoded;
}