本文整理汇总了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());
}
示例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;
}
示例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);
}
示例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;
}
示例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();
}
示例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();
}
示例7: getDataSource
import org.oscim.tiling.ITileDataSource; //导入依赖的package包/类
@Override
public ITileDataSource getDataSource() {
return new UrlTileDataSource(this, new MapTrekTileDecoder(), getHttpEngine());
}
示例8: getDataSource
import org.oscim.tiling.ITileDataSource; //导入依赖的package包/类
@Override
public ITileDataSource getDataSource() {
return new UrlTileDataSource(this, new TileDecoder(), getHttpEngine());
}
示例9: getDataSource
import org.oscim.tiling.ITileDataSource; //导入依赖的package包/类
@Override
public ITileDataSource getDataSource() {
return null;
}
示例10: getDataSource
import org.oscim.tiling.ITileDataSource; //导入依赖的package包/类
@Override
public ITileDataSource getDataSource() {
return new UrlTileDataSource(this, new BitmapTileDecoder(), getHttpEngine());
}
示例11: getDataSource
import org.oscim.tiling.ITileDataSource; //导入依赖的package包/类
@Override
public ITileDataSource getDataSource() {
return new TileDataSource();
}
示例12: setDataSource
import org.oscim.tiling.ITileDataSource; //导入依赖的package包/类
public void setDataSource(ITileDataSource dataSource) {
dispose();
mTileDataSource = dataSource;
}
示例13: getDataSource
import org.oscim.tiling.ITileDataSource; //导入依赖的package包/类
@Override
public ITileDataSource getDataSource() {
return new UrlTileDataSource(this, new GeoJsonTileDecoder(this), getHttpEngine());
}
示例14: getDataSource
import org.oscim.tiling.ITileDataSource; //导入依赖的package包/类
@Override
public ITileDataSource getDataSource() {
return new TestTileDataSource(this, null, getHttpEngine());
}
示例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() {
}
};
}