本文整理汇总了Java中org.mapsforge.map.rendertheme.InternalRenderTheme.DEFAULT属性的典型用法代码示例。如果您正苦于以下问题:Java InternalRenderTheme.DEFAULT属性的具体用法?Java InternalRenderTheme.DEFAULT怎么用?Java InternalRenderTheme.DEFAULT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.mapsforge.map.rendertheme.InternalRenderTheme
的用法示例。
在下文中一共展示了InternalRenderTheme.DEFAULT属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRenderTheme
private XmlRenderTheme getRenderTheme() {
try {
return InternalRenderTheme.DEFAULT;
} catch (Exception e) {
Analytics.sendException(getContext(), e, false);
}
return InternalRenderTheme.OSMARENDER;
}
示例2: getTilegenerator
private static OsmTilegenerator getTilegenerator(File[] mapsforgeFiles, Integer tileSize, Float scaleFactor) {
if (tileSize == null || tileSize < 256) {
tileSize = TILESIZE;
}
if (scaleFactor == null)
scaleFactor = 1.5f;
MapWorkerPool.NUMBER_OF_THREADS = 4;
// Map buffer size
ReadBuffer.setMaximumBufferSize(6500000);
// Square frame buffer
FrameBufferController.setUseSquareFrameBuffer(false);
DisplayModel model = new DisplayModel();
model.setUserScaleFactor(scaleFactor);
model.setFixedTileSize(tileSize);
DataPolicy dataPolicy = DataPolicy.RETURN_ALL;
MultiMapDataStore mapDatabase = new MultiMapDataStore(dataPolicy);
for (int i = 0; i < mapsforgeFiles.length; i++)
mapDatabase.addMapDataStore(new MapFile(mapsforgeFiles[i]), false, false);
InMemoryTileCache tileCache = new InMemoryTileCache(200);
DatabaseRenderer renderer = new DatabaseRenderer(mapDatabase, AwtGraphicFactory.INSTANCE, tileCache,
new TileBasedLabelStore(tileCache.getCapacityFirstLevel()), true, true);
InternalRenderTheme xmlRenderTheme = InternalRenderTheme.DEFAULT;
RenderThemeFuture theme = new RenderThemeFuture(AwtGraphicFactory.INSTANCE, xmlRenderTheme, model);
// super important!! without the following line, all rendering
// activities will block until the theme is created.
new Thread(theme).start();
// TODO get back external themes
// DatabaseRenderer dbRenderer = null;
// XmlRenderTheme xmlRenderTheme = null;
// DisplayModel displayModel = null;
// if (mapsforgeFile.exists()) {
// mapDatabase.openFile(mapsforgeFile);
// dbRenderer = new DatabaseRenderer(mapDatabase, graphicFactory);
//
// String mapName =
// FileUtilities.getNameWithoutExtention(mapsforgeFiles[0]);
// File xmlStyleFile = new File(mapsforgeFiles[0].getParentFile(),
// mapName + ".xml");
// if (xmlStyleFile.exists()) {
// try {
// xmlRenderTheme = new ExternalRenderTheme(xmlStyleFile);
// } catch (Exception e) {
// xmlRenderTheme = InternalRenderTheme.OSMARENDER;
// }
// } else {
// xmlRenderTheme = InternalRenderTheme.OSMARENDER;
// }
// displayModel = new DisplayModel();
// displayModel.setUserScaleFactor(tileSize / 256f);
// }
return new OsmTilegenerator(mapDatabase, renderer, theme, model, tileSize);
}