Interface Region

com.yandex.mapkit.offline_cache

public interface Region

Attention.

This feature is not available in the free MapKit version.

Region information.

Methods

void addListener(@NonNull RegionListener regionListener)

Subscribe the listener to receive all manager notifications.

void drop()

Drop region data from the device.

Point getCenter()

Center point.

List< String > getCities()

Cities inside the region.

String getCountry()

Country of the region.

LocalizedValue getDownloadSize()

Returns the size of the download in bytes.

String getName()

Name of the region.

float getProgress()

Returns the download progress (0..1).

int getRegionId()

Region ID.

long getReleaseTime()

Returns the region creation time.

RegionState getState()

State of the region.

boolean isValid()

Tells if this Region is valid or no.

boolean mayBeOutOfAvailableSpace()

Returns true if available disk space might not be enough for installation of the region data.

void pause()

Pause the download.

void removeListener(@NonNull RegionListener regionListener)

Unsubscribe the listener from receiving all manager notifications.

void start()

Add the map to the download queue.

void stop()

Cancel the download, if any.

Method Detail

addListener

public void addListener (@NonNull RegionListener regionListener)

Subscribe the listener to receive all manager notifications.

drop

public void drop ()

Drop region data from the device.

If data is being downloaded then downloading is cancelled.

getCenter

public Point getCenter ()

Center point.

getCities

public List< String > getCities ()

Cities inside the region.

getCountry

public String getCountry ()

Country of the region.

getDownloadSize

public LocalizedValue getDownloadSize ()

Returns the size of the download in bytes.

getName

public String getName ()

Name of the region.

getProgress

public float getProgress ()

Returns the download progress (0..1).

getRegionId

public int getRegionId ()

Region ID.

getReleaseTime

public long getReleaseTime ()

Returns the region creation time.

getState

public RegionState getState ()

State of the region.

isValid

public boolean isValid ()

Tells if this Region is valid or no.

Any other method (except for this one) called on an invalid Region will throw java.lang.RuntimeException. An instance becomes invalid only on UI thread, and only when its implementation depends on objects already destroyed by now. Please refer to general docs about the interface for details on its invalidation.

mayBeOutOfAvailableSpace

public boolean mayBeOutOfAvailableSpace ()

Returns true if available disk space might not be enough for installation of the region data.

pause

public void pause ()

Pause the download.

removeListener

public void removeListener (@NonNull RegionListener regionListener)

Unsubscribe the listener from receiving all manager notifications.

start

public void start ()

Add the map to the download queue.

The download will be started (resumed) immediately.

stop

public void stop ()

Cancel the download, if any.