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


Java MapView.setBuiltInZoomControls方法代码示例

本文整理汇总了Java中org.mapsforge.map.android.view.MapView.setBuiltInZoomControls方法的典型用法代码示例。如果您正苦于以下问题:Java MapView.setBuiltInZoomControls方法的具体用法?Java MapView.setBuiltInZoomControls怎么用?Java MapView.setBuiltInZoomControls使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.mapsforge.map.android.view.MapView的用法示例。


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

示例1: initMap

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
private void initMap() {
    AndroidGraphicFactory.createInstance(getApplication());
    mapView = new MapView(this);

    mapView.setClickable(true);
    mapView.getMapScaleBar().setVisible(false);
    mapView.setBuiltInZoomControls(false);
    mapView.setZoomLevelMin((byte) 2);
    mapView.setZoomLevelMax((byte) 10);

    mapView.setZoomLevel((byte) 2);
    mapView.getModel().displayModel.setBackgroundColor(ContextCompat.getColor(this, R.color.mapBackground));

    layers = mapView.getLayerManager().getLayers();

    MapCreator mapCreator = new MapCreator(this, layers);
    mapCreator.parseGeoJson("world_map.geo.json");

    initServerOnMap(layers);

    LinearLayout map = (LinearLayout) findViewById(R.id.map);
    map.addView(mapView);
}
 
开发者ID:MaxSmile,项目名称:EasyVPN-Free,代码行数:24,代码来源:HomeActivity.java

示例2: onCreate

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
@Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_map);
    locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 3000, 5, this);
    Variable.getVariable().setContext(getApplicationContext());
    Variable.getVariable().setZoomLevels(22, 1);
    AndroidGraphicFactory.createInstance(getApplication());
    mapView = new MapView(this);
    mapView.setClickable(true);
    mapView.setBuiltInZoomControls(false);
    MapHandler.getMapHandler()
            .init(this, mapView, Variable.getVariable().getCountry(), Variable.getVariable().getMapsFolder());
    MapHandler.getMapHandler().loadMap(new File(Variable.getVariable().getMapsFolder().getAbsolutePath(),
            Variable.getVariable().getCountry() + "-gh"));
    customMapView();
    checkGpsAvailability();

    getMyLastLocation();
    updateCurrentLocation(null);
}
 
开发者ID:junjunguo,项目名称:PocketMaps,代码行数:22,代码来源:MapActivity.java

示例3: onCreate

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mapView = new MapView(this);
    mapView.setClickable(true);
    mapView.getMapScaleBar().setVisible(true);
    mapView.setBuiltInZoomControls(true);
    mapView.getMapZoomControls().setZoomLevelMin((byte) 5);
    mapView.getMapZoomControls().setZoomLevelMax((byte) 20);

    worldMap = new MapFile(new File(Constant.PATH_WORLDMAP));
    taiwanMap = new MapFile(new File(Constant.PATH_TAIWANMAP));
    multiMapDataStore = new MultiMapDataStore(MultiMapDataStore.DataPolicy.RETURN_ALL);

    tileCache = AndroidUtil.createTileCache(this, "mapcache", mapView.getModel().displayModel.getTileSize(), 1f, this.mapView.getModel().frameBufferModel.getOverdrawFactor());
    setContentView(mapView);
}
 
开发者ID:lienching,项目名称:MapsforgeSample,代码行数:19,代码来源:SimpleMapView.java

示例4: onCreate

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
@Override public void onCreate(Bundle bundle) {
	if (DEBUG) Log.d(TAG, "Map.onCreate bundle=" + bundle);
	super.onCreate(bundle);
	// AndroidGraphicFactory.createInstance(getActivity().getApplication());
	mapView = new MapView(getActivity()) {
		@Override public boolean onTouchEvent(MotionEvent motionEvent) {
			if (snapToLocationEnabled) {
				informSnapToLocation(false);
			}
			return super.onTouchEvent(motionEvent);
		}
	};
	preferences = getActivity().getSharedPreferences("map", Context.MODE_PRIVATE);
	mapView.setClickable(true);
	// TODO: consider mapView.setGestureDetector();?
	mapView.getMapScaleBar().setVisible(false);
	mapView.getModel().mapViewPosition.setZoomLevelMin((byte) 4);
	mapView.getModel().mapViewPosition.setZoomLevelMax((byte) 20);
	mapView.getModel();
	mapView.setBuiltInZoomControls(false);
	mapView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
	DisplayModel displayModel = mapView.getModel().displayModel;
	displayModel.setBackgroundColor(0xffbbbbbb);
	displayModel.setUserScaleFactor(1.5f);
}
 
开发者ID:emdete,项目名称:tabulae,代码行数:26,代码来源:Map.java

示例5: onCreate

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
@Override public void onCreate(Bundle bundle) {
	super.onCreate(bundle);
	if (DEBUG) { Log.d(TAG, "Map.onCreate"); }
	AndroidGraphicFactory.createInstance(getActivity().getApplication());
	mapView = new MapView(getActivity());
	//
	mapView.setClickable(true);
	mapView.getMapScaleBar().setVisible(true);
	mapView.setBuiltInZoomControls(true);
	mapView.getMapZoomControls().setZoomLevelMin((byte)2);
	mapView.getMapZoomControls().setZoomLevelMax((byte)18);
	mapView.getMapZoomControls().setShowMapZoomControls(true);
	mapView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
	tileCache = AndroidUtil.createTileCache(getActivity(), "mapcache", mapView.getModel().displayModel.getTileSize(),
		1f, mapView.getModel().frameBufferModel.getOverdrawFactor());

	polyline = new AlternatingLine(AndroidGraphicFactory.INSTANCE);
}
 
开发者ID:emdete,项目名称:Simplicissimus,代码行数:19,代码来源:Map.java

示例6: onCreate

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle bundle) {
	super.onCreate(bundle);
	if (DEBUG) {
		Log.d(TAG, "Map.onCreate");
	}
	AndroidGraphicFactory.createInstance(getActivity().getApplication());
	mapView = new MapView(getActivity());
	preferencesFacade = new AndroidPreferences(getActivity().getSharedPreferences("map", Context.MODE_PRIVATE));
	mapView.getModel().init(preferencesFacade);
	if (mapView.getModel().mapViewPosition.getZoomLevel() == 0) {
		// warp to 'unter den linden'
		mapView.getModel().mapViewPosition.setCenter(new LatLong(52.517037, 13.38886));
		mapView.getModel().mapViewPosition.setZoomLevel((byte)12);
	}
	mapView.setClickable(true);
	mapView.getMapScaleBar().setVisible(true);
	mapView.setBuiltInZoomControls(true);
	mapView.getMapZoomControls().setZoomLevelMin((byte) 2);
	mapView.getMapZoomControls().setZoomLevelMax((byte) 18);
	mapView.getMapZoomControls().setShowMapZoomControls(true);
	mapView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
	tileCache = createExternalStorageTileCache(getActivity(), "osmarender", 50, mapView.getModel().displayModel.getTileSize());
}
 
开发者ID:emdete,项目名称:Simplicissimus,代码行数:25,代码来源:Map.java

示例7: onCreate

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
@Override public void onCreate(Bundle bundle) {
	super.onCreate(bundle);
	if (DEBUG) { Log.d(TAG, "Map.onCreate"); }
	AndroidGraphicFactory.createInstance(getActivity().getApplication());
	mapView = new MapView(getActivity());
	//
	mapView.setClickable(true);
	mapView.getMapScaleBar().setVisible(true);
	mapView.setBuiltInZoomControls(true);
	mapView.getMapZoomControls().setZoomLevelMin((byte)2);
	mapView.getMapZoomControls().setZoomLevelMax((byte)18);
	mapView.getMapZoomControls().setShowMapZoomControls(true);
	mapView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
	for (int i=0;i<tileCaches.length;i++) {
		tileCaches[i]= AndroidUtil.createTileCache(getActivity(),
			"mapcache-" + i, mapView.getModel().displayModel.getTileSize(), 1f,
			mapView.getModel().frameBufferModel.getOverdrawFactor());
	}
}
 
开发者ID:emdete,项目名称:Simplicissimus,代码行数:20,代码来源:Map.java

示例8: onCreate

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
@Override public void onCreate(Bundle bundle) {
	super.onCreate(bundle);
	if (DEBUG) { Log.d(TAG, "Map.onCreate"); }
	AndroidGraphicFactory.createInstance(getActivity().getApplication());
	mapView = new MapView(getActivity());
	//
	mapView.setClickable(true);
	mapView.getMapScaleBar().setVisible(true);
	mapView.setBuiltInZoomControls(true);
	mapView.getMapZoomControls().setZoomLevelMin((byte)2);
	mapView.getMapZoomControls().setZoomLevelMax((byte)18);
	mapView.getMapZoomControls().setShowMapZoomControls(true);
	mapView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
	tileCache = AndroidUtil.createTileCache(getActivity(), "mapcache", mapView.getModel().displayModel.getTileSize(),
		1f, mapView.getModel().frameBufferModel.getOverdrawFactor());
}
 
开发者ID:emdete,项目名称:Simplicissimus,代码行数:17,代码来源:Map.java

示例9: onCreate

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
@Override public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	if (DEBUG) Log.d(TAG, "onCreate");
	Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
		@Override
		public void uncaughtException(Thread thread, Throwable e) {
			Log.e(TAG, "error e=" + e, e);
			finish();
		}
	});
	AndroidGraphicFactory.createInstance(getApplication());
	mapView = new MapView(this);
	setContentView(mapView);
	mapView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
	mapView.setClickable(true);
	mapView.getMapScaleBar().setVisible(true);
	mapView.setBuiltInZoomControls(true);
	mapView.getMapZoomControls().setZoomLevelMin((byte)2);
	mapView.getMapZoomControls().setZoomLevelMax((byte)18);
	mapView.getMapZoomControls().setShowMapZoomControls(true);
	// create a tile cache of suitable size
	tileCache = AndroidUtil.createTileCache(this, "mapcache",
		mapView.getModel().displayModel.getTileSize(), 1f,
		mapView.getModel().frameBufferModel.getOverdrawFactor());
}
 
开发者ID:emdete,项目名称:Simplicissimus,代码行数:26,代码来源:Sample.java

示例10: onCreate

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
@Override public void onCreate(Bundle bundle) {
	super.onCreate(bundle);
	if (DEBUG) { Log.d(TAG, "Map.onCreate"); }
	AndroidGraphicFactory.createInstance(getActivity().getApplication());
	mapView = new MapView(getActivity());
	//
	mapView.setClickable(true);
	AndroidUtil.setMapScaleBar(mapView, MetricUnitAdapter.INSTANCE, null);
	mapView.getMapScaleBar().setVisible(true);
	mapView.setBuiltInZoomControls(true);
	mapView.getMapZoomControls().setZoomLevelMin((byte)2);
	mapView.getMapZoomControls().setZoomLevelMax((byte)18);
	mapView.getMapZoomControls().setShowMapZoomControls(true);
	mapView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
	DisplayModel displayModel = mapView.getModel().displayModel;
	displayModel.setBackgroundColor(0xffff0000); // red background, defaults to 0xffeeeeee
	displayModel.setFixedTileSize(512); // change the tile size, defaults to 256
	// displayModel.setMaxTextWidthFactor(0.3f); // defaults to .7f
	// displayModel.setTileSizeMultiple(100); // defaults to 64
	displayModel.setUserScaleFactor(1.5f); // scaled map, defaults to 1.0f
	tileCache = AndroidUtil.createTileCache(getActivity(), "mapcache", mapView.getModel().displayModel.getTileSize(),
		1f, mapView.getModel().frameBufferModel.getOverdrawFactor());
}
 
开发者ID:emdete,项目名称:Simplicissimus,代码行数:24,代码来源:Map.java

示例11: createMapViews

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
protected void createMapViews() {
	MapView mapView = getMapView();
	mapView.getModel().init(this.preferencesFacade);
	mapView.setClickable(true);
	mapView.getMapScaleBar().setVisible(true);
	mapView.setBuiltInZoomControls(hasZoomControls());
	mapView.getMapZoomControls().setZoomLevelMin((byte) 10);
	mapView.getMapZoomControls().setZoomLevelMax((byte) 20);
	registerForContextMenu(mapView);
	this.mapViews.add(mapView);
}
 
开发者ID:nirabpudasaini,项目名称:Mero-Bhada-Meter,代码行数:12,代码来源:OfflineMapActivity.java

示例12: initMapView

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
private void initMapView(MapView mapView, Activity activity) {
    String  cacheName = "mymapcache";
    String  mapName   = "taiwan.map";
    LatLong initLoc   = new LatLong(25.076, 121.544);

    // create MapDataStore
    File mapFile = new File(Environment.getExternalStorageDirectory(), mapName);
    MapDataStore mapDataStore = new MapFile(mapFile);

    // create TileCache
    TileCache tileCache = AndroidUtil.createTileCache(
        activity,
        cacheName,
        mapView.getModel().displayModel.getTileSize(),
        1f,
        mapView.getModel().frameBufferModel.getOverdrawFactor()
    );

    // create TileRendererLayer, need MapDataStore & TileCache
    TileRendererLayer tileRendererLayer = new TileRendererLayer(
        tileCache,
        mapDataStore,
        mapView.getModel().mapViewPosition,
        false,
        true,
        AndroidGraphicFactory.INSTANCE
    );
    tileRendererLayer.setXmlRenderTheme(InternalRenderTheme.OSMARENDER);

    // set UI of mapView
    mapView.setClickable(false);
    mapView.getMapScaleBar().setVisible(false);
    mapView.setBuiltInZoomControls(false);
    //mapView.getMapZoomControls().setZoomLevelMin((byte)12);
    //mapView.getMapZoomControls().setZoomLevelMax((byte)17);
    mapView.getModel().mapViewPosition.setCenter(initLoc);
    mapView.getModel().mapViewPosition.setZoomLevel((byte)17);

    // add Layer to mapView
    mapView.getLayerManager().getLayers().add(tileRendererLayer);
}
 
开发者ID:OsmHackTW,项目名称:AndroidMapExample,代码行数:42,代码来源:MainActivityFragment.java


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