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


Java MapView.getModel方法代码示例

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


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

示例1: 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

示例2: 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

示例3: LayerGoogleSat

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
LayerGoogleSat(Tabulae activity, MapView mapView) {
	super(activity, mapView, true);
	tileLayer = new TileDownloadLayer(tileCache, mapView.getModel().mapViewPosition,
			new Source(), AndroidGraphicFactory.INSTANCE);
	mapView.getLayerManager().getLayers().add(0, tileLayer);
	setVisible(false);
}
 
开发者ID:emdete,项目名称:tabulae,代码行数:8,代码来源:LayerGoogleSat.java

示例4: LayerBingSat

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
LayerBingSat(Tabulae activity, MapView mapView) {
	super(activity, mapView, true);
	tileLayer = new TileDownloadLayer(tileCache, mapView.getModel().mapViewPosition,
			new Source(), AndroidGraphicFactory.INSTANCE);
	mapView.getLayerManager().getLayers().add(0, tileLayer);
	setVisible(false);
}
 
开发者ID:emdete,项目名称:tabulae,代码行数:8,代码来源:LayerBingSat.java

示例5: init

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
/**
 * initializes the map view, here from source
 */
protected void init() {
    mapView = (MapView) findViewById(R.id.mapview);
    btn_myl = (ImageView) findViewById(R.id.btn_myl);
    hint_overlay = (ScrollView) findViewById(R.id.hint_overlay);
    hint_titolo = (TextView) findViewById(R.id.hint_titolo);
    TextView hint_desc = (TextView) findViewById(R.id.hint_desc);
    hint = (TextView) findViewById(R.id.hint);
    point_image = (ImageView) findViewById(R.id.point_image);
    codeEditText = (EditText) findViewById(R.id.code);
    compass = (ImageView) findViewById(R.id.compass);
    points_status = (TextView) findViewById(R.id.points_status);

    if (level == OrientiringApplication.LEVEL_EXTREME)
        compass.setVisibility(View.GONE);

    if (level == OrientiringApplication.LEVEL_DIFFICULT || level == OrientiringApplication.LEVEL_EXTREME) {
        hint_desc.setText(R.string.hint_desc_diff);
        hint.setVisibility(View.GONE);
    }

    initializeMapView(mapView, preferencesFacade);

    tileCache = createTileCache();

    layerManager = mapView.getLayerManager();

    mapViewPosition = mapView.getModel().mapViewPosition;
    mapViewPosition.setMapPosition(getInitialPosition());

    addLayers(tileCache, mapViewPosition);

    showNextPoint();
}
 
开发者ID:monossido,项目名称:CoopTDMOrienteering,代码行数:37,代码来源:MapsActivity.java

示例6: 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

示例7: LayerOutdoorActive

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
LayerOutdoorActive(Tabulae activity, MapView mapView) {
	super(activity, mapView, true);
	tileLayer = new TileDownloadLayer(tileCache, mapView.getModel().mapViewPosition, new Source(), AndroidGraphicFactory.INSTANCE);
	mapView.getLayerManager().getLayers().add(0, tileLayer);
	setVisible(false);
}
 
开发者ID:emdete,项目名称:tabulae,代码行数:7,代码来源:LayerOutdoorActive.java

示例8: LayerMapQuest

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
LayerMapQuest(Tabulae activity, MapView mapView) {
	super(activity, mapView, true);
	tileLayer = new TileDownloadLayer(tileCache, mapView.getModel().mapViewPosition, new Source(), AndroidGraphicFactory.INSTANCE);
	mapView.getLayerManager().getLayers().add(0, tileLayer);
	setVisible(false);
}
 
开发者ID:emdete,项目名称:tabulae,代码行数:7,代码来源:LayerMapQuest.java

示例9: LayerWanderreitKarte

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
LayerWanderreitKarte(Tabulae activity, MapView mapView) {
	super(activity, mapView, true);
	tileLayer = new TileDownloadLayer(tileCache, mapView.getModel().mapViewPosition, new Source(), AndroidGraphicFactory.INSTANCE);
	mapView.getLayerManager().getLayers().add(0, tileLayer);
	setVisible(false);
}
 
开发者ID:emdete,项目名称:tabulae,代码行数:7,代码来源:LayerWanderreitKarte.java

示例10: addLayer

import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
/**
 * Adds a tile layer using a FileSystemTileCache to the map view
 * @param activity	Context of the map view.
 * @param name	Identifier for the layer.
 * @param url	URL to the tile source. Must have {z},{x} and {y} place holders.
 * @param subdomains	Sub domains, if any, for the tile source.
 * @param parallelrequests	Number of parallel requests the tile source can handle.
 * @param maxzoom	Highest zoom level for the tile source.
 * @param minzoom	Lowest zoom level for the tile source.
 */
public void addLayer(Activity activity, String name, String url, String[] subdomains,
		int parallelrequests, byte maxzoom, byte minzoom){
	MapView mapView = (MapView) getNativeView();
	GenericTileSource tileSource = new GenericTileSource(url, subdomains, parallelrequests, maxzoom, minzoom);
	TileDownloadLayer downloadLayer = new TileDownloadLayer(createTileCache(activity, name), mapView.getModel().mapViewPosition, tileSource, mGraphicFactory);
	mapView.getLayerManager().getLayers().add(downloadLayer);
	mLayers.put(name, downloadLayer);
	debugMsg("Added layer " + name + " with url " + url);
}
 
开发者ID:snowciety,项目名称:sc.mapsforge,代码行数:20,代码来源:MapsforgeView.java


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