use of io.jawg.osmcontributor.offline.events.OfflineRegionCreatedEvent in project osm-contributor by jawg.
the class OfflineRegionDownloadService method downloadOfflineRegion.
public void downloadOfflineRegion(LatLngBounds latLngBounds, final String regionName) {
final OfflineTilePyramidRegionDefinition definition = new OfflineTilePyramidRegionDefinition(BuildConfig.MAP_STYLE_URL, latLngBounds, MIN_ZOOM, MAX_ZOOM, this.getResources().getDisplayMetrics().density);
// Build the notification
buildNotification(regionName);
offlineRegionManager.createOfflineRegion(definition, regionName, new OfflineRegionManager.OnOfflineRegionCreatedListener() {
@Override
public void onOfflineRegionCreated(OfflineRegion offlineRegion, String regionName) {
// Monitor the download progress using setObserver
offlineRegion.setObserver(getOfflineRegionObserver(regionName));
startDownloadOfflineRegion(offlineRegion);
eventBus.post(new OfflineRegionCreatedEvent());
}
});
}
Aggregations