當前位置: 首頁>>代碼示例>>Java>>正文


Java ITileDataSource類代碼示例

本文整理匯總了Java中org.oscim.tiling.ITileDataSource的典型用法代碼示例。如果您正苦於以下問題:Java ITileDataSource類的具體用法?Java ITileDataSource怎麽用?Java ITileDataSource使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ITileDataSource類屬於org.oscim.tiling包,在下文中一共展示了ITileDataSource類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getDataSource

import org.oscim.tiling.ITileDataSource; //導入依賴的package包/類
@Override
public ITileDataSource getDataSource() {

	ITileDecoder tileDecoder;

	switch (_mapProvider.tileEncoding) {
	case MVT:

		tileDecoder = new org.oscim.tiling.source.mvt.TileDecoder();

		break;

	case VTM:
	default:
		tileDecoder = new org.oscim.tiling.source.oscimap4.TileDecoder();
		break;
	}

	return new UrlTileDataSource(this, tileDecoder, getHttpEngine());
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:21,代碼來源:Map25TileSource.java

示例2: getDataSource

import org.oscim.tiling.ITileDataSource; //導入依賴的package包/類
@Override
public ITileDataSource getDataSource() {
    try {
        Constructor con = mTileDatabase.getConstructor(SQLiteTileSource.class, ITileDecoder.class);
        ITileDecoder tileDecoder = "vtm".equals(getOption("format")) ? new TileDecoder() : new BitmapTileDecoder();
        return (ITileDataSource) con.newInstance(this, tileDecoder);
    } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) {
        e.printStackTrace();
    }
    return null;
}
 
開發者ID:andreynovikov,項目名稱:trekarta,代碼行數:12,代碼來源:SQLiteTileSource.java

示例3: getDataSource

import org.oscim.tiling.ITileDataSource; //導入依賴的package包/類
@Override
public ITileDataSource getDataSource() {
    MapTrekDataSource mapTrekDataSource = new MapTrekDataSource(mNativeMapDatabase);
    mapTrekDataSource.setContoursEnabled(mContoursEnabled);
    mMapTrekDataSources.add(mapTrekDataSource);
    return new NativeDataSource(mapTrekDataSource);
}
 
開發者ID:andreynovikov,項目名稱:trekarta,代碼行數:8,代碼來源:MapTrekTileSource.java

示例4: getDataSource

import org.oscim.tiling.ITileDataSource; //導入依賴的package包/類
@Override
public ITileDataSource getDataSource() {
	try {
		return new MapDatabase(this);
	} catch (IOException e) {
		log.debug(e.getMessage());
	}
	return null;
}
 
開發者ID:opensciencemap,項目名稱:vtm,代碼行數:10,代碼來源:MapFileTileSource.java

示例5: shouldUseLwHttp

import org.oscim.tiling.ITileDataSource; //導入依賴的package包/類
@Test
public void shouldUseLwHttp() throws Exception {
	LwHttp lwHttp = Mockito.mock(LwHttp.class);
	tileSource.setHttpEngine(new TestHttpFactory(lwHttp));
	ITileDataSource dataSource = tileSource.getDataSource();
	dataSource.dispose();
	Mockito.verify(lwHttp).close();
}
 
開發者ID:opensciencemap,項目名稱:vtm,代碼行數:9,代碼來源:BitmapTileSourceTest.java

示例6: shouldUseOkHttp

import org.oscim.tiling.ITileDataSource; //導入依賴的package包/類
@Test
public void shouldUseOkHttp() throws Exception {
	OkHttpEngine okHttp = Mockito.mock(OkHttpEngine.class);
	tileSource.setHttpEngine(new TestHttpFactory(okHttp));
	ITileDataSource dataSource = tileSource.getDataSource();
	dataSource.dispose();
	Mockito.verify(okHttp).close();
}
 
開發者ID:opensciencemap,項目名稱:vtm,代碼行數:9,代碼來源:OSciMap4TileSourceTest.java

示例7: getDataSource

import org.oscim.tiling.ITileDataSource; //導入依賴的package包/類
@Override
public ITileDataSource getDataSource() {
    return new UrlTileDataSource(this, new MapTrekTileDecoder(), getHttpEngine());
}
 
開發者ID:andreynovikov,項目名稱:trekarta,代碼行數:5,代碼來源:MapTrekUrlTileSource.java

示例8: getDataSource

import org.oscim.tiling.ITileDataSource; //導入依賴的package包/類
@Override
public ITileDataSource getDataSource() {
	return new UrlTileDataSource(this, new TileDecoder(), getHttpEngine());
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:5,代碼來源:CustomTileSource.java

示例9: getDataSource

import org.oscim.tiling.ITileDataSource; //導入依賴的package包/類
@Override
public ITileDataSource getDataSource() {
	return null;
}
 
開發者ID:opensciencemap,項目名稱:vtm,代碼行數:5,代碼來源:JsBitmapTileSource.java

示例10: getDataSource

import org.oscim.tiling.ITileDataSource; //導入依賴的package包/類
@Override
public ITileDataSource getDataSource() {
	return new UrlTileDataSource(this, new BitmapTileDecoder(), getHttpEngine());
}
 
開發者ID:opensciencemap,項目名稱:vtm,代碼行數:5,代碼來源:BitmapTileSource.java

示例11: getDataSource

import org.oscim.tiling.ITileDataSource; //導入依賴的package包/類
@Override
public ITileDataSource getDataSource() {
	return new TileDataSource();
}
 
開發者ID:opensciencemap,項目名稱:vtm,代碼行數:5,代碼來源:TestTileSource.java

示例12: setDataSource

import org.oscim.tiling.ITileDataSource; //導入依賴的package包/類
public void setDataSource(ITileDataSource dataSource) {
	dispose();
	mTileDataSource = dataSource;
}
 
開發者ID:opensciencemap,項目名稱:vtm,代碼行數:5,代碼來源:VectorTileLoader.java

示例13: getDataSource

import org.oscim.tiling.ITileDataSource; //導入依賴的package包/類
@Override
public ITileDataSource getDataSource() {

	return new UrlTileDataSource(this, new GeoJsonTileDecoder(this), getHttpEngine());
}
 
開發者ID:opensciencemap,項目名稱:vtm,代碼行數:6,代碼來源:GeoJsonTileSource.java

示例14: getDataSource

import org.oscim.tiling.ITileDataSource; //導入依賴的package包/類
@Override
public ITileDataSource getDataSource() {
	return new TestTileDataSource(this, null, getHttpEngine());
}
 
開發者ID:opensciencemap,項目名稱:vtm,代碼行數:5,代碼來源:UrlTileSourceTest.java

示例15: getDataSource

import org.oscim.tiling.ITileDataSource; //導入依賴的package包/類
@Override
public ITileDataSource getDataSource() {
	return new ITileDataSource() {

		@Override
		public void query(MapTile tile, ITileDataSink sink) {
			log.debug("query {}", tile);
			try {
				Tile t = mTileDataset.read(tile.zoomLevel, tile.tileX,
				                           // flip Y axis
				                           (1 << tile.zoomLevel) - 1 - tile.tileY);
				if (t == null) {
					log.debug("not found {}", tile);
					sink.completed(TILE_NOT_FOUND);
					return;
				}
				Bitmap b = CanvasAdapter.decodeBitmap(new ByteArrayInputStream(t.getData()));
				sink.setTileImage(b);
				log.debug("success {}", tile);
				sink.completed(SUCCESS);
				return;

			} catch (IOException e) {
				e.printStackTrace();
			}
			log.debug("fail {}", tile);
			sink.completed(FAILED);
		}

		@Override
		public void dispose() {

		}

		@Override
		public void cancel() {

		}

	};
}
 
開發者ID:opensciencemap,項目名稱:vtm,代碼行數:42,代碼來源:JeoTileSource.java


注:本文中的org.oscim.tiling.ITileDataSource類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。