当前位置: 首页>>代码示例>>Java>>正文


Java VtmThemes类代码示例

本文整理汇总了Java中org.oscim.theme.VtmThemes的典型用法代码示例。如果您正苦于以下问题:Java VtmThemes类的具体用法?Java VtmThemes怎么用?Java VtmThemes使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VtmThemes类属于org.oscim.theme包,在下文中一共展示了VtmThemes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: is

import org.oscim.theme.VtmThemes; //导入依赖的package包/类
public static boolean is(ThemeFile tf1, ThemeFile tf2) {
    if (tf1 == tf2) return true;
    if (tf1 == null || tf2 == null) return false;

    if (tf1 instanceof VtmThemes) {
        if (tf2 instanceof VtmThemes) {
            VtmThemes t1 = (VtmThemes) tf1;
            VtmThemes t2 = (VtmThemes) tf2;
            if (!t1.name().equals(t2.name())) return false;
            return true;
        } else {
            return false;
        }
    }

    log.warn("Unknown themFile comparsion for class {}", tf1.getClass().getName());

    return false;
}
 
开发者ID:Longri,项目名称:cachebox3.0,代码行数:20,代码来源:EQUALS.java

示例2: onCreate

import org.oscim.theme.VtmThemes; //导入依赖的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));
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:17,代码来源:TestActivity.java

示例3: onCreate

import org.oscim.theme.VtmThemes; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	mMap.setTheme(VtmThemes.DEFAULT);

	TileSource ts = OSciMap4TileSource.builder()
	    .url("http://opensciencemap.org/tiles/s3db")
	    .zoomMin(16)
	    .zoomMax(16)
	    .build();

	if (USE_CACHE) {
		mS3dbCache = new TileCache(this, null, "s3db.db");
		mS3dbCache.setCacheSize(512 * (1 << 10));
		ts.setCache(mS3dbCache);
	}
	TileLayer tl = new S3DBLayer(mMap, ts, true, false);
	mMap.layers().add(tl);
	mMap.layers().add(new LabelLayer(mMap, mBaseLayer));
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:22,代码来源:S3DBMapActivity.java

示例4: onMenuItemSelected

import org.oscim.theme.VtmThemes; //导入依赖的package包/类
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {

	switch (item.getItemId()) {
		case R.id.theme_default:
			mMap.setTheme(VtmThemes.DEFAULT);
			item.setChecked(true);
			return true;

		case R.id.theme_tubes:
			mMap.setTheme(VtmThemes.TRONRENDER);
			item.setChecked(true);
			return true;

		case R.id.theme_osmarender:
			mMap.setTheme(VtmThemes.OSMARENDER);
			item.setChecked(true);
			return true;
	}

	return false;
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:23,代码来源:MapsforgeMapActivity.java

示例5: createLayers

import org.oscim.theme.VtmThemes; //导入依赖的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);
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:20,代码来源:MapsforgeTest.java

示例6: createLayers

import org.oscim.theme.VtmThemes; //导入依赖的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);
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:20,代码来源:RuleVisitorTest.java

示例7: createApplication

import org.oscim.theme.VtmThemes; //导入依赖的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);
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:27,代码来源:RobovmLauncher.java

示例8: initDefaultLayers

import org.oscim.theme.VtmThemes; //导入依赖的package包/类
protected void initDefaultLayers(TileSource tileSource, boolean tileGrid, boolean labels,
        boolean buildings) {
	Layers layers = mMap.layers();

	if (tileSource != null) {
		mMapLayer = mMap.setBaseMap(tileSource);
		mMap.setTheme(VtmThemes.DEFAULT);

		if (buildings)
			layers.add(new BuildingLayer(mMap, mMapLayer));

		if (labels)
			layers.add(new LabelLayer(mMap, mMapLayer));
	}

	if (tileGrid)
		layers.add(new TileGridLayer(mMap));
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:19,代码来源:GdxMap.java

示例9: setPreferences

import org.oscim.theme.VtmThemes; //导入依赖的package包/类
void setPreferences(SharedPreferences preferences) {
	setBaseMap(preferences);

	ThemeFile theme = VtmThemes.DEFAULT;
	if (preferences.contains("theme")) {
		String name = preferences.getString("theme", "DEFAULT");
		try {
			theme = VtmThemes.valueOf(name);
		} catch (IllegalArgumentException e) {
			theme = VtmThemes.DEFAULT;
		}
	}

	App.map.setTheme(theme);

	// default cache size 20MB
	int cacheSize = preferences.getInt("cacheSize", 20);

	if (mCache != null)
		mCache.setCacheSize(cacheSize * (1 << 20));

}
 
开发者ID:opensciencemap,项目名称:vtm-app,代码行数:23,代码来源:MapLayers.java

示例10: getTheme

import org.oscim.theme.VtmThemes; //导入依赖的package包/类
private ThemeFile getTheme(final Map25Provider mapProvider) {

		switch (mapProvider.tileEncoding) {
		case MVT:
			return VtmThemes.MAPZEN;

		// Open Science Map
		case VTM:
		default:
			return VtmThemes.DEFAULT;
		}
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:13,代码来源:Map25App.java

示例11: onCreate

import org.oscim.theme.VtmThemes; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	mMap.addTask(new Runnable() {
		@Override
		public void run() {
			showToast("load data");
			InputStream is = null;
			try {
				//	File file = new File(Environment.getExternalStorageDirectory()
				//	    .getAbsolutePath(), "osmindoor.json");
				//	is = new FileInputStream(file);

				URL url = new URL(PATH);
				URLConnection conn = url.openConnection();
				is = conn.getInputStream();
				loadJson(is);
			} catch (IOException e) {
				e.printStackTrace();
			} finally {
				IOUtils.closeQuietly(is);
			}
		}
	});

	mMap.layers().add(new BuildingLayer(mMap, mBaseLayer));
	mMap.layers().add(new LabelLayer(mMap, mBaseLayer));
	mMap.setTheme(VtmThemes.TRONRENDER);

	//mMap.setMapPosition(49.417, 8.673, 1 << 17);
	mMap.setMapPosition(53.5620092, 9.9866457, 1 << 16);

	//	mMap.layers().add(new TileGridLayer(mMap));
	//	String file = Environment.getExternalStorageDirectory().getAbsolutePath();
	//	VectorDataset data = (VectorDataset) JeoTest.getJsonData(file + "/states.json", true);
	//	Style style = JeoTest.getStyle();
	//	mMap.layers().add(new JeoVectorLayer(mMap, data, style));
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:40,代码来源:JeoIndoorMapActivity.java

示例12: onCreate

import org.oscim.theme.VtmThemes; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	Map m = this.map();

	Layers layers = mMap.layers();
	layers.add(new BuildingLayer(mMap, mBaseLayer));
	layers.add(new LabelLayer(mMap, mBaseLayer));
	layers.add(new MapScaleBar(mMapView));

	m.setTheme(VtmThemes.DEFAULT);
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:13,代码来源:SimpleMapActivity.java

示例13: onActivityResult

import org.oscim.theme.VtmThemes; //导入依赖的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);
			}
		}
	}
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:41,代码来源:MapsforgeMapActivity.java

示例14: onCreate

import org.oscim.theme.VtmThemes; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	((SeekBar) findViewById(R.id.seekBarH)).setOnSeekBarChangeListener(this);
	((SeekBar) findViewById(R.id.seekBarS)).setOnSeekBarChangeListener(this);
	((SeekBar) findViewById(R.id.seekBarV)).setOnSeekBarChangeListener(this);

	Layers layers = mMap.layers();
	layers.add(new BuildingLayer(mMap, mBaseLayer));
	layers.add(new LabelLayer(mMap, mBaseLayer));

	mMap.setTheme(VtmThemes.DEFAULT);
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:14,代码来源:ThemeStylerActivity.java

示例15: createLayers

import org.oscim.theme.VtmThemes; //导入依赖的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));
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:29,代码来源:Gdx3DTest.java


注:本文中的org.oscim.theme.VtmThemes类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。