本文整理汇总了Java中org.oscim.layers.tile.vector.VectorTileLayer类的典型用法代码示例。如果您正苦于以下问题:Java VectorTileLayer类的具体用法?Java VectorTileLayer怎么用?Java VectorTileLayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VectorTileLayer类属于org.oscim.layers.tile.vector包,在下文中一共展示了VectorTileLayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import org.oscim.layers.tile.vector.VectorTileLayer; //导入依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
Map map = this.map();
VectorTileLayer baseLayer = map.setBaseMap(new OSciMap4TileSource());
map.layers().add(new BuildingLayer(map, baseLayer));
map.layers().add(new LabelLayer(map, baseLayer));
map.setTheme(VtmThemes.DEFAULT);
//mMap.setMapPosition(49.417, 8.673, 1 << 17);
map.setMapPosition(53.5620092, 9.9866457, 1 << 16);
// mMap.layers().add(new TileGridLayer(mMap));
}
示例2: createLayers
import org.oscim.layers.tile.vector.VectorTileLayer; //导入依赖的package包/类
@Override
public void createLayers() {
UrlTileSource tileSource = OSciMap4TileSource.builder()
//.url("http://vector.dev.mapzen.com/osm/all")
.url("http://vector.mapzen.com/osm/all")
.zoomMax(18)
.httpFactory(new OkHttpEngine.OkHttpFactory())
.build();
VectorTileLayer l = mMap.setBaseMap(tileSource);
loadTheme();
mMap.layers().add(new BuildingLayer(mMap, l));
mMap.layers().add(new LabelLayer(mMap, l));
mMap.setMapPosition(53.08, 8.82, 1 << 17);
}
示例3: createLayers
import org.oscim.layers.tile.vector.VectorTileLayer; //导入依赖的package包/类
@Override
public void createLayers() {
MapRenderer.setBackgroundColor(0xff888888);
mMap.setMapPosition(53.072, 8.80, 1 << 15);
// mMap.setMapPosition(52.5, 13.3, 1 << 15);
MapFileTileSource tileSource = new MapFileTileSource();
tileSource.setMapFile("/home/jeff/Downloads/bremen.map");
VectorTileLayer l = mMap.setBaseMap(tileSource);
mMap.layers().add(new BuildingLayer(mMap, l));
mMap.layers().add(new LabelLayer(mMap, l));
// mMap.setTheme(VtmThemes.DEFAULT);
// mMap.setTheme(VtmThemes.TRONRENDER);
mMap.setTheme(VtmThemes.OSMARENDER);
}
示例4: onKeyDown
import org.oscim.layers.tile.vector.VectorTileLayer; //导入依赖的package包/类
@Override
protected boolean onKeyDown(int keycode) {
VectorTileLayer l = (VectorTileLayer) mMap.layers().get(1);
RenderTheme t = (RenderTheme) l.getTheme();
if (keycode == Input.Keys.NUM_1) {
mSaturation += 0.1;
t.traverseRules(new SaturateLineStyles(mSaturation, true, true, true));
t.updateStyles();
mMap.render();
return true;
}
if (keycode == Input.Keys.NUM_2) {
mSaturation -= 0.1;
t.traverseRules(new SaturateLineStyles(mSaturation, true, true, true));
t.updateStyles();
mMap.render();
return true;
}
return super.onKeyDown(keycode);
}
示例5: createLayers
import org.oscim.layers.tile.vector.VectorTileLayer; //导入依赖的package包/类
@Override
public void createLayers() {
MapRenderer.setBackgroundColor(0xf0f0f0);
TileSource ts = new OSciMap4TileSource();
VectorTileLayer l = mMap.setBaseMap(ts);
mMap.setTheme(VtmThemes.DEFAULT);
RenderTheme t = (RenderTheme) l.getTheme();
mTheme = t;
//t.traverseRules(new DesaturateAreaStyles());
//t.traverseRules(new DesaturateLineStyles());
t.traverseRules(new SaturateLineStyles(0.5, true, true, true));
t.updateStyles();
//mMap.setMapPosition(7.707, 81.689, 1 << 16);
mMap.setMapPosition(53.08, 8.82, 1 << 16);
}
示例6: createApplication
import org.oscim.layers.tile.vector.VectorTileLayer; //导入依赖的package包/类
@Override
protected IOSApplication createApplication() {
IOSApplicationConfiguration config = new IOSApplicationConfiguration();
config.orientationLandscape = true;
config.orientationPortrait = true;
config.stencilFormat = GLKViewDrawableStencilFormat._8;
return new IOSApplication(new GdxMap() {
@Override
public void createLayers() {
TileSource tileSource = new OSciMap4TileSource();
//initDefaultLayers(tileSource, false,true, false);
VectorTileLayer l = mMap.setBaseMap(tileSource);
mMap.setTheme(VtmThemes.NEWTRON);
mMap.layers().add(new BuildingLayer(mMap, l));
mMap.layers().add(new LabelLayer(mMap, l));
// mMap.getLayers().add(new GenericLayer(mMap, new
// GridRenderer(1,new Line(Color.LTGRAY, 1.2f),null)));
mMap.setMapPosition(53.1, 8.8, 1 << 14);
}
}, config);
}
示例7: initialize
import org.oscim.layers.tile.vector.VectorTileLayer; //导入依赖的package包/类
private void initialize() {
ITileCache cache = new SharedTileCache(getContext());
cache.setCacheSize(512 * (1 << 10));
OSciMap4TileSource tileSource = new OSciMap4TileSource();
tileSource.setCache(cache);
VectorTileLayer baseLayer = map().setBaseMap(tileSource);
Layers layers = map().layers();
layers.add(drawables = new ClearableVectorLayer(map()));
layers.add(labels = new LabelLayer(map(), baseLayer));
layers.add(buildings = new BuildingLayer(map(), baseLayer));
layers.add(items = new ItemizedLayer<MarkerItem>(map(), new MarkerSymbol(
new AndroidBitmap(BitmapFactory.decodeResource(getContext().getResources(), R.drawable.nop)), 0.5F, 1)));
map().setTheme(MicrogThemes.DEFAULT);
}
示例8: __constructor__
import org.oscim.layers.tile.vector.VectorTileLayer; //导入依赖的package包/类
public void __constructor__(Map map, TileManager tileManager,
VectorTileRenderer renderer, int numLoaders) {
field("mTileLoader").ofType(TileLoader[].class).in(realVectorTileLayer)
.set(new TileLoader[0]);
field("mLoaderThemeHooks").ofType(VectorTileLayer.TileLoaderThemeHook[].class)
.in(realVectorTileLayer).set(new VectorTileLayer.TileLoaderThemeHook[0]);
field("mLoaderProcessHooks").ofType(VectorTileLayer.TileLoaderProcessHook[].class)
.in(realVectorTileLayer).set(new VectorTileLayer.TileLoaderProcessHook[0]);
}
示例9: setBaseMap
import org.oscim.layers.tile.vector.VectorTileLayer; //导入依赖的package包/类
/**
* Create OsmTileLayer with given TileSource and
* set as base map (layer 1)
*
* TODO deprecate
*/
public VectorTileLayer setBaseMap(TileSource tileSource) {
VectorTileLayer l = new OsmTileLayer(this);
l.setTileSource(tileSource);
setBaseMap(l);
return l;
}
示例10: setTheme
import org.oscim.layers.tile.vector.VectorTileLayer; //导入依赖的package包/类
public void setTheme(IRenderTheme theme) {
if (theme == null) {
throw new IllegalArgumentException("Theme cannot be null.");
}
if (mBaseLayer == null) {
log.warn("No base layer set.");
} else if (mBaseLayer instanceof VectorTileLayer) {
((VectorTileLayer) mBaseLayer).setRenderTheme(theme);
}
MapRenderer.setBackgroundColor(theme.getMapBackground());
clearMap();
}
示例11: LabelLayer
import org.oscim.layers.tile.vector.VectorTileLayer; //导入依赖的package包/类
public LabelLayer(Map map, VectorTileLayer l) {
super(map);
l.getManager().events.bind(this);
l.addHook(new LabelTileLoaderHook());
mLabelPlacer = new LabelPlacement(map, l.tileRenderer());
mWorker = new Worker(map);
mRenderer = new TextRenderer(mWorker);
}
示例12: BuildingLayer
import org.oscim.layers.tile.vector.VectorTileLayer; //导入依赖的package包/类
public BuildingLayer(Map map, VectorTileLayer tileLayer, int zoomMin, int zoomMax) {
super(map);
tileLayer.addHook(this);
mRenderer = new BuildingRenderer(tileLayer.tileRenderer(),
zoomMin, zoomMax,
false, TRANSLUCENT);
if (POST_AA)
mRenderer = new OffscreenRenderer(Mode.SSAO_FXAA, mRenderer);
}
示例13: onActivityResult
import org.oscim.layers.tile.vector.VectorTileLayer; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == SELECT_MAP_FILE) {
if (resultCode != RESULT_OK || intent == null)
return;
if (intent.getStringExtra(FilePicker.SELECTED_FILE) == null)
return;
mTileSource = new MapFileTileSource();
String file = intent.getStringExtra(FilePicker.SELECTED_FILE);
if (mTileSource.setMapFile(file)) {
VectorTileLayer l = mMap.setBaseMap(mTileSource);
mMap.setTheme(VtmThemes.DEFAULT);
mMap.layers().add(new BuildingLayer(mMap, l));
mMap.layers().add(new LabelLayer(mMap, l));
MapInfo info = mTileSource.getMapInfo();
if (info.boundingBox != null) {
MapPosition pos = new MapPosition();
pos.setByBoundingBox(info.boundingBox,
Tile.SIZE * 4,
Tile.SIZE * 4);
mMap.setMapPosition(pos);
Samples.log.debug("set position {}", pos);
} else if (info.mapCenter != null) {
double scale = 1 << 8;
if (info.startZoomLevel != null)
scale = 1 << info.startZoomLevel.intValue();
mMap.setMapPosition(info.mapCenter.getLatitude(),
info.mapCenter.getLongitude(),
scale);
}
}
}
}
示例14: createLayers
import org.oscim.layers.tile.vector.VectorTileLayer; //导入依赖的package包/类
@Override
public void createLayers() {
mMap.setMapPosition(53.08, 8.83, 1 << 14);
// TileSource tileSource = new OSciMap4TileSource();
MapFileTileSource tileSource = new MapFileTileSource();
// tileSource.setMapFile("/home/jeff/src/vtm/Freizeitkarte_DEU_NW.map");
tileSource.setMapFile("/home/jeff/germany.map");
VectorTileLayer l = mMap.setBaseMap(tileSource);
mapLayer = l;
// mMap.getLayers().add(new BuildingLayer(mMap, l.getTileLayer()));
mMap.layers().add(new LabelLayer(mMap, l));
try {
IRenderTheme theme = ThemeLoader
.load("themes/freizeitkarte/theme.xml");
// IRenderTheme theme =
// ThemeLoader.load("themes/elevate/theme.xml");
// IRenderTheme theme = ThemeLoader.load("themes/vmap/theme.xml");
l.setRenderTheme(theme);
MapRenderer.setBackgroundColor(theme.getMapBackground());
} catch (FileNotFoundException e) {
e.printStackTrace();
}
// mMap.getLayers().add(new GenericLayer(mMap, new MeshRenderer()));
// mMap.getLayers().add(new GenericLayer(mMap, new GridRenderer()));
}
示例15: createLayers
import org.oscim.layers.tile.vector.VectorTileLayer; //导入依赖的package包/类
@Override
public void createLayers() {
MapRenderer.setBackgroundColor(0xff888888);
mMap.setMapPosition(53.1, 8.8, 1 << 15);
TileSource ts = new OSciMap4TileSource();
// initDefaultLayers(ts, false, false, false);
VectorTileLayer mMapLayer = mMap.setBaseMap(ts);
mMap.setTheme(VtmThemes.DEFAULT);
// mMap.setTheme(VtmThemes.TRONRENDER);
mMap.layers().add(new BuildingLayer(mMap, mMapLayer));
// mMap.getLayers().add(new GenericLayer(mMap, new GridRenderer()));
// ts = new OSciMap4TileSource("http://opensciencemap.org/tiles/s3db");
// VectorTileLayer tl = new VectorTileLayer(mMap, 16, 16, 20);
// tl.setTileSource(ts);
// tl.setRenderTheme(ThemeLoader.load(VtmThemes.DEFAULT));
// mMap.getLayers().add(tl);
// mMap.getLayers().add(new BuildingLayer(mMap, tl.getTileLayer()));
mMap.layers().add(new Poi3DLayer(mMap, mMapLayer));
mMap.layers().add(new LabelLayer(mMap, mMapLayer));
}