当前位置: 首页>>代码示例>>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;未经允许,请勿转载。