prefetch abstract method

TaskHandle prefetch(
  1. GeoPolygon geoPolygon,
  2. PrefetchStatusListener callback
)

Prefetches map data for an area bounded by geo polygon.

After the operation is finished PrefetchStatusListener.onComplete is invoked on the main thread. Progress is reported by invocation of PrefetchStatusListener.onProgress on the main thread. If there is not enough space left in the cache to store needed tiles, operation will fail with MapLoaderError.notEnoughSpace. To increase cache size, use SDKOptions.cacheSizeInBytes API.

To control list of map content features for area prefetch, use LayerConfiguration.enabledFeatures.

To prefetch map data within user-defined circular area around a given location:

  1. Create a GeoCircle using the given location and radius.
  2. Create a GeoPolygon using the GeoCircle.
  3. Pass the afroementioned GeoPolygon to the sdk.prefetcher.PolygonPrefetcher.prefetch API. Usage: GeoCircle geoCircle = GeoCircle(location, radius); GeoPolygon geoPolygon = GeoPolygon.withGeoCircle(geoCircle);
  • geoPolygon Area to prefetch map data for.

  • callback Callback that is triggered to report progress and the result of prefetch.

Returns TaskHandle. Handle that will be used to manipulate execution of the task.

Implementation

TaskHandle prefetch(GeoPolygon geoPolygon, PrefetchStatusListener callback);