本文整理匯總了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() {
}
};
}