GeocodeCacheOptions class

Configuration options for GeocodingService.

All options have sensible defaults and can be overridden via GeocodingService.configure.

const options = GeocodeCacheOptions(
  cacheRadiusMeters: 20,
  maxAge: Duration(days: 7),
  maxCacheSize: 500,
);

Constructors

GeocodeCacheOptions({double cacheRadiusMeters = 10.0, String boxName = 'geocode_cache', Duration? maxAge, String userAgent = 'geocode_cache/1.0', String addressFormatter(String? street, String? locality, String? administrativeArea, String? country)?, int maxCacheSize = 250})
Creates a new GeocodeCacheOptions instance.
const

Properties

addressFormatter String Function(String? street, String? locality, String? administrativeArea, String? country)?
Custom address formatter callback.
final
boxName String
Name of the Hive box used to persist geocode results.
final
cacheRadiusMeters double
Radius in meters within which a cached result is considered a match.
final
hashCode int
The hash code for this object.
no setterinherited
maxAge Duration?
Maximum age of a cached entry before it is treated as stale.
final
maxCacheSize int
Maximum number of entries to keep in the geocode cache.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
userAgent String
User-Agent string sent with HTTP requests to Nominatim.
final

Methods

copyWith({double? cacheRadiusMeters, String? boxName, Duration? maxAge, String? userAgent, int? maxCacheSize, String addressFormatter(String? street, String? locality, String? administrativeArea, String? country)?}) GeocodeCacheOptions
Creates a copy of this options with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited