MPGoogleBaseMapCacheProvider

The base-map tile cache for Google Maps, which reports that base-map caching is unavailable rather than attempting it.

The Google Maps SDK exposes no per-region offline tile API — there is no equivalent of Mapbox's OfflineManager/TileStore to download a bounded area into — so this provider cannot cache anything. Rather than leave a host app guessing, every operation reports MIError.BASEMAP_CACHE_NOT_SUPPORTED. A host app that calls into base-map caching on a Google build learns why nothing happened. Should Google ever ship a per-region offline API, this class is where it would be implemented.

Register it the same way as any other provider, before or without a map:

MPDataSetCacheManager.getInstance().setBaseMapCacheProvider(MPGoogleBaseMapCacheProvider())

isBaseMapCachingSupported returns false, so a caller can skip the work entirely instead of collecting one failure per region. cachedRegionIds is the exception to the failure rule: it succeeds with an empty list, because "nothing is cached" is a true and useful answer.

Callbacks are delivered on a background thread, never inline on the calling thread, so that this provider behaves like a provider that really does the work.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
Link copied to clipboard
open override fun cachedRegionSize(regionId: String, listener: OnResultAndDataReadyListener<Long>)
Link copied to clipboard
open override fun cacheRegion(regionId: String, bounds: MPLatLngBounds, minZoom: Int, maxZoom: Int, listener: MPBaseMapCacheRegionListener?)
Link copied to clipboard
open override fun isBaseMapCachingSupported(): Boolean
Link copied to clipboard
open override fun removeCachedRegion(regionId: String, listener: OnResultReadyListener?)
Link copied to clipboard
open override fun terminate()