url property

Uri url

Implementation

Uri get url {
  final url = Uri(
    scheme: "https",
    host: "maps.googleapis.com",
    path: "/maps/api/staticmap",
    queryParameters: _queryParameters,
  );

  final urlSize = url.toString().length;

  if (urlSize > maxGoogleStaticMapsUrlSize) {
    String errorMessage = 'Too large url. '
        'Maps Static API URLs are restricted '
        'to 8192 characters in size.';

    if (mapId == null && styles != null) {
      errorMessage += "\nTIP: You can use \"mapId\" instead of \"styles\".";
    }

    throw StateError(errorMessage);
  }

  return url;
}