fromLatLng static method

FormattedLocation fromLatLng({
  1. required double lat,
  2. required double lon,
  3. String placeId = '',
  4. String addressType = '',
  5. String category = '',
  6. String licence = '',
  7. String type = '',
  8. String name = '',
  9. String osmType = '',
  10. String? displayName,
  11. String? icon,
  12. Address address = const Address(),
  13. Map<String, String> names = const {},
  14. Map<String, String> extratags = const {},
  15. Map<String, String> namedetails = const {},
  16. LatLngBounds? boundingBox,
  17. GeoGeometry? geojson,
  18. double importance = 0,
  19. int placeRank = 0,
  20. int osmId = 0,
})

Implementation

static FormattedLocation fromLatLng({
  required double lat,
  required double lon,
  String placeId = '',
  String addressType = '',
  String category = '',
  String licence = '',
  String type = '',
  String name = '',
  String osmType = '',
  String? displayName,
  String? icon,
  Address address = const Address(),
  Map<String, String> names = const {},
  Map<String, String> extratags = const {},
  Map<String, String> namedetails = const {},
  LatLngBounds? boundingBox,
  GeoGeometry? geojson,
  double importance = 0,
  int placeRank = 0,
  int osmId = 0,
}) {
  return FormattedLocation(
    placeId: placeId,
    address: address,
    lat: lat,
    lon: lon,
    addressType: addressType,
    boundingBox: boundingBox,
    category: category,
    displayName: displayName ?? '$lat, $lon',
    extratags: extratags,
    geojson: geojson ??
        GeoGeometry.point(
          LatLng(lat, lon),
          Color((math.Random().nextDouble() * 0xFFFFFF).toInt())
              .withOpacity(1.0),
        ),
    importance: importance,
    licence: licence,
    name: name,
    namedetails: namedetails,
    osmId: osmId,
    osmType: osmType,
    placeRank: placeRank,
    type: type,
    icon: icon,
  );
}