本文整理汇总了Java中org.mapsforge.map.android.view.MapView.setClickable方法的典型用法代码示例。如果您正苦于以下问题:Java MapView.setClickable方法的具体用法?Java MapView.setClickable怎么用?Java MapView.setClickable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.mapsforge.map.android.view.MapView
的用法示例。
在下文中一共展示了MapView.setClickable方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例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());
}
}
示例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());
}
示例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());
}
示例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());
}
示例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);
}
示例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);
}
示例13: initializeMapView
import org.mapsforge.map.android.view.MapView; //导入方法依赖的package包/类
/**
* initializes the map view
*
* @param mapView the map view
*/
protected void initializeMapView(MapView mapView, PreferencesFacade preferences) {
mapView.getModel().init(preferences);
mapView.setClickable(true);
mapView.getMapScaleBar().setVisible(true);
}