本文整理汇总了Java中org.osmdroid.tileprovider.modules.NetworkAvailabliltyCheck类的典型用法代码示例。如果您正苦于以下问题:Java NetworkAvailabliltyCheck类的具体用法?Java NetworkAvailabliltyCheck怎么用?Java NetworkAvailabliltyCheck使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NetworkAvailabliltyCheck类属于org.osmdroid.tileprovider.modules包,在下文中一共展示了NetworkAvailabliltyCheck类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CycleMapTileProvider
import org.osmdroid.tileprovider.modules.NetworkAvailabliltyCheck; //导入依赖的package包/类
private CycleMapTileProvider(final Context context,
final ITileSource tileSource,
final IRegisterReceiver registerReceiver) {
super(tileSource, registerReceiver);
final MapTileFilesystemProvider fileSystemProvider =
new MapTileFilesystemProvider(registerReceiver, tileSource);
mTileProviderList.add(fileSystemProvider);
final NetworkAvailabliltyCheck networkCheck = new NetworkAvailabliltyCheck(context);
final MapTileDownloader downloaderProvider =
new MapTileDownloader(tileSource,
new TileWriter(),
networkCheck);
mTileProviderList.add(downloaderProvider);
final MapsforgeOSMDroidTileProvider mapsforgeProvider =
new MapsforgeOSMDroidTileProvider(tileSource, networkCheck);
mTileProviderList.add(mapsforgeProvider);
}
示例2: getMapTileDownloader
import org.osmdroid.tileprovider.modules.NetworkAvailabliltyCheck; //导入依赖的package包/类
private MapTileDownloader getMapTileDownloader(final ITileSource tileSource) {
// Create a file cache modular provider
//FIXME: Der Cache-Mechanismus speichert die Tiles unter "/osmdroid/<kartenname>". Dies sollte man unterbinden,
// da es evtl zu Konflikten mit Apps kommt, die auch osmdroid verwenden!
final TileWriter tileWriter = new TileWriter();
// Create a download modular tile provider
final NetworkAvailabliltyCheck networkAvailabliltyCheck = new NetworkAvailabliltyCheck(context);
//ACHTUNG: Der Downloader funktioniert aktuell nur mit dem FilesystemProvider ordnungsgemäß!! Eigenständig
// funkioniert dieser nicht! Es liegt daran, dass die überschriebene Methode "tileLoaded" in der internen
// TileLoader-Klasse nicht dafür vorgesehen ist. Es funktioniert allerdings, wenn man die überschriebene
// Methode nicht überschreibt!
final MapTileDownloader downloaderProvider =
new MapTileDownloader(tileSource, tileWriter, networkAvailabliltyCheck);
return downloaderProvider;
}
示例3: MapsforgeOSMDroidTileProvider
import org.osmdroid.tileprovider.modules.NetworkAvailabliltyCheck; //导入依赖的package包/类
public MapsforgeOSMDroidTileProvider(final ITileSource fallbackSource,
final NetworkAvailabliltyCheck networkCheck)
{
super(NUMBER_OF_TILE_DOWNLOAD_THREADS, TILE_DOWNLOAD_MAXIMUM_QUEUE_SIZE);
tileSource_ = null;
fallbackTileSource_ = fallbackSource instanceof OnlineTileSourceBase ? (OnlineTileSourceBase)fallbackSource : null;
networkCheck_ = networkCheck;
}
示例4: createMapOBSO
import org.osmdroid.tileprovider.modules.NetworkAvailabliltyCheck; //导入依赖的package包/类
private void createMapOBSO() {
final Context context = this;
final Context applicationContext = context.getApplicationContext();
final IRegisterReceiver registerReceiver = new SimpleRegisterReceiver(applicationContext);
// Create a custom tile source
final ITileSource tileSource = new XYTileSource("Mapnik", ResourceProxy.string.mapnik, 1, 18, 256, ".png", "http://tile.openstreetmap.org/");
// Create a file cache modular provider
final TileWriter tileWriter = new TileWriter();
final MapTileFilesystemProvider fileSystemProvider = new MapTileFilesystemProvider(registerReceiver, tileSource);
// Create an archive file modular tile provider
//GEMFFileArchive gemfFileArchive = GEMFFileArchive.getGEMFFileArchive(mGemfArchiveFilename ); // Requires try/catch
//MapTileFileArchiveProvider fileArchiveProvider = new MapTileFileArchiveProvider(registerReceiver, tileSource, new IArchiveFile[] { gemfFileArchive });
// Create a download modular tile provider
final NetworkAvailabliltyCheck networkAvailabliltyCheck = new NetworkAvailabliltyCheck(context);
final MapTileDownloader downloaderProvider = new MapTileDownloader(tileSource, tileWriter, networkAvailabliltyCheck);
// Create a custom tile provider array with the custom tile source and the custom tile providers
//final MapTileProviderArray tileProviderArray = new MapTileProviderArray(tileSource, registerReceiver, new MapTileModuleProviderBase[] { fileSystemProvider, fileArchiveProvider, downloaderProvider });
final MapTileProviderArray tileProviderArray = new MapTileProviderArray(tileSource, registerReceiver, new MapTileModuleProviderBase[] { fileSystemProvider, downloaderProvider });
//final MapTileProviderArray tileProviderArray = new MapTileProviderArray(tileSource, registerReceiver, new MapTileModuleProviderBase[] { downloaderProvider });
// Create the mapview with the custom tile provider array
//mMapView = new MapView(context, 256, new DefaultResourceProxyImpl(context), tileProviderArray);
MapView mMapView = (MapView) findViewById(R.id.mapview);
mMapView.setTileSource(tileSource);
}
示例5: SafeMapTileProviderBasic
import org.osmdroid.tileprovider.modules.NetworkAvailabliltyCheck; //导入依赖的package包/类
/**
* Creates a {@link SafeMapTileProviderBasic}.
*/
public SafeMapTileProviderBasic(final Context pContext, final ITileSource pTileSource) {
this(pContext, new SimpleRegisterReceiver(pContext), new NetworkAvailabliltyCheck(pContext),
pTileSource);
}
示例6: MapTileProviderBasic
import org.osmdroid.tileprovider.modules.NetworkAvailabliltyCheck; //导入依赖的package包/类
/**
* Creates a {@link MapTileProviderBasic}.
*/
public MapTileProviderBasic(final Context pContext, final ITileSource pTileSource) {
this(new SimpleRegisterReceiver(pContext), new NetworkAvailabliltyCheck(pContext),
pTileSource, pContext,null);
}
示例7: GeoPackageProvider
import org.osmdroid.tileprovider.modules.NetworkAvailabliltyCheck; //导入依赖的package包/类
public GeoPackageProvider(File[] db, Context context) {
this(new SimpleRegisterReceiver(context), new NetworkAvailabliltyCheck(context),
TileSourceFactory.DEFAULT_TILE_SOURCE, context, null, db);
}
示例8: WMSMapTileProviderBasic
import org.osmdroid.tileprovider.modules.NetworkAvailabliltyCheck; //导入依赖的package包/类
/**
* Creates a {@link MapTileProviderBasic}.
*/
public WMSMapTileProviderBasic(final Context pContext,
final ITileSource pTileSource) {
this(new SimpleRegisterReceiver(pContext),
new NetworkAvailabliltyCheck(pContext), pTileSource);
}
示例9: MapTileProviderLocal
import org.osmdroid.tileprovider.modules.NetworkAvailabliltyCheck; //导入依赖的package包/类
/**
* @param pContext
* @param pTileSource
*/
public MapTileProviderLocal(String basePath, Context pContext, ITileSource pTileSource) {
this(basePath, new SimpleRegisterReceiver(pContext), new NetworkAvailabliltyCheck(pContext), pTileSource);
}