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


Java MapView.setBuiltInZoomControls方法代码示例

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


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

示例1: onCreate

import com.google.android.maps.MapView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.main);

    MapView mapView = (MapView) findViewById(R.id.mapview);
    mapView.setBuiltInZoomControls(true);

    /**
     * To show a map of San Francisco, we need to create a geo point object
     * with longitude and latitude in center of SF.
     */
    GeoPoint point = new GeoPoint(37779300, -122419200);

    /**
     * MapController is needed to set view location and zooming.
     */
    MapController mc = mapView.getController();
    mc.setCenter(point);
    mc.setZoom(14);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:23,代码来源:MapActivity.java

示例2: onCreate

import com.google.android.maps.MapView; //导入方法依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
	Log.i("rawphone", "Starting MapViewer ============");   	
	super.onCreate(savedInstanceState);
    setContentView(R.layout.map);
    
    ImageView imagev = new ImageView(this);
    mapv = (MapView) findViewById(R.id.mapView);  
    mapv.setBuiltInZoomControls(true);
    mapv.displayZoomControls(true);
    
    myDB=null;
    try {        	
    	myDB =  this.openOrCreateDatabase(DB_NAME, MODE_PRIVATE, null);
    	loadentries();
    } catch (SQLiteException se ) {
    	Log.e(getClass().getSimpleName(), "Could not Open the database:" +se);
    	myDB=null;
    }
}
 
开发者ID:jofrep,项目名称:Android-RawPhone,代码行数:23,代码来源:MapViewer.java

示例3: onCreate

import com.google.android.maps.MapView; //导入方法依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_map);
    init();
    
    mapView = (MapView) findViewById(R.id.mapview);
	mapView.setBuiltInZoomControls(true);
	mapController = mapView.getController();
	mapController.setZoom(13);
	
	startPoints = mapView.getOverlays();
	itemizedOverlay = new MapOverlay(getResources().getDrawable(R.drawable.marker));
	
	rebuildList();
}
 
开发者ID:marchold,项目名称:taxi-driver-droid,代码行数:18,代码来源:TaxiDriverMapActivity.java

示例4: onActivityCreated

import com.google.android.maps.MapView; //导入方法依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
	super.onActivityCreated(savedInstanceState);
	mListCheckinModel = new ListCheckinModel();
	mListCheckinModel.load();
	mCheckinModel = mListCheckinModel.getCheckins(getActivity());
	showUsers();
	mHandler = new Handler();
	map = new MapView(getActivity(), getActivity().getString(
			R.string.google_map_api_key));
	Preferences.loadSettings(getActivity());
	if (mCheckinModel.size() > 0) {
		map.setClickable(true);
		map.setBuiltInZoomControls(true);
		mHandler.post(mMarkersOnMap);

	} else {
		toastLong(R.string.no_checkin);
	}

	((ViewGroup) getView()).addView(map);

}
 
开发者ID:bartfaizoltan,项目名称:Joszolgalat_Android_App,代码行数:24,代码来源:MapCheckinFragment.java

示例5: onActivityCreated

import com.google.android.maps.MapView; //导入方法依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
	super.onActivityCreated(savedInstanceState);
	mListReportModel = new ListReportModel();
	mListReportModel.load();
	mReportModel = mListReportModel.getReports(getActivity());
	showCategories();
	mHandler = new Handler();
	apiUtils = new ApiUtils(getActivity());
	map = new MapView(getActivity(), getActivity().getString(
			R.string.google_map_api_key));
	Preferences.loadSettings(getActivity());
	if (mReportModel.size() > 0) {
		map.setClickable(true);
		map.setBuiltInZoomControls(true);
		mHandler.post(mMarkersOnMap);

	} else {
		toastLong(R.string.no_reports);
	}
	((ViewGroup) getView()).addView(map);
}
 
开发者ID:bartfaizoltan,项目名称:Joszolgalat_Android_App,代码行数:23,代码来源:MapFragment.java

示例6: initMap

import com.google.android.maps.MapView; //导入方法依赖的package包/类
private void initMap() {
    mMapView = (MapView)findViewById(R.id.mapView);
    mMapView.setBuiltInZoomControls(true);
    mMapController = mMapView.getController();

    mMyLocationOverlay = new CrashFixMyLocationOverlay(this, mMapView);
    mMapView.getOverlays().add(mMyLocationOverlay);
    mMyLocationOverlay.runOnFirstFix(new Runnable() {
        public void run() {
            if (DEBUG) Log.d(TAG, "runOnFirstFix()");
            mMapView.getController().animateTo(mMyLocationOverlay.getMyLocation());
            mMapView.getController().setZoom(16);
        }
    });
}
 
开发者ID:Kamshak,项目名称:foursquared,代码行数:16,代码来源:SearchVenuesMapActivity.java

示例7: initMap

import com.google.android.maps.MapView; //导入方法依赖的package包/类
private void initMap() {
	
    mMapView = (MapView) findViewById(R.id.mapView);
    mMapView.setBuiltInZoomControls(true);
    mMapController = mMapView.getController();

    mMyLocationOverlay = new CrashFixMyLocationOverlay(this, mMapView);
    mMapView.getOverlays().add(mMyLocationOverlay);
    
    loadSearchResults(mStateHolder.getCheckins());
    
    mCallout = (MapCalloutView) findViewById(R.id.map_callout);
    mCallout.setVisibility(View.GONE);
    mCallout.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent = new Intent(FriendsMapActivity.this, VenueActivity.class);
            intent.setAction(Intent.ACTION_VIEW);
            intent.putExtra(VenueActivity.INTENT_EXTRA_VENUE_PARTIAL, mTappedVenue);
            startActivity(intent);
        }
    });
    
    recenterMap();
}
 
开发者ID:Kamshak,项目名称:foursquared,代码行数:26,代码来源:FriendsMapActivity.java

示例8: ensureUi

import com.google.android.maps.MapView; //导入方法依赖的package包/类
private void ensureUi() {
    
    mMapView = (MapView) findViewById(R.id.mapView);
    mMapView.setBuiltInZoomControls(true);
    mMapController = mMapView.getController();

    mMyLocationOverlay = new CrashFixMyLocationOverlay(this, mMapView);
    mMapView.getOverlays().add(mMyLocationOverlay);

    mCallout = (MapCalloutView) findViewById(R.id.map_callout);
    mCallout.setVisibility(View.GONE);
    mCallout.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent = new Intent(NearbyVenuesMapActivity.this, VenueActivity.class);
            intent.setAction(Intent.ACTION_VIEW);
            intent.putExtra(VenueActivity.INTENT_EXTRA_VENUE_ID, mTappedVenueId);
            startActivity(intent);
        }
    });
    
    // One CheckinItemizedOverlay per group!
    VenueItemizedOverlayWithIcons mappableVenuesOverlay = createMappableVenuesOverlay(
            mStateHolder.getVenues());

    if (mappableVenuesOverlay != null) {
        mVenueGroupOverlays.add(mappableVenuesOverlay);
    }
    
    if (mVenueGroupOverlays.size() > 0) {
        mMapView.getOverlays().addAll(mVenueGroupOverlays);
        
        recenterMap();
    } else {
        Toast.makeText(this, getResources().getString(
                R.string.friendsmapactivity_no_checkins), Toast.LENGTH_LONG).show();
        finish();
    }
}
 
开发者ID:Kamshak,项目名称:foursquared,代码行数:40,代码来源:NearbyVenuesMapActivity.java

示例9: initMap

import com.google.android.maps.MapView; //导入方法依赖的package包/类
private void initMap() {
    mMapView = (MapView)findViewById(R.id.mapView);
    mMapView.setBuiltInZoomControls(true);
    mMapController = mMapView.getController();

    mMyLocationOverlay = new CrashFixMyLocationOverlay(this, mMapView);
    mMapView.getOverlays().add(mMyLocationOverlay);
}
 
开发者ID:vsvankhede,项目名称:foursquared.eclair,代码行数:9,代码来源:FriendsMapActivity.java

示例10: initMap

import com.google.android.maps.MapView; //导入方法依赖的package包/类
private void initMap() {
    mMapView = (MapView)findViewById(R.id.mapView);
    mMapView.setBuiltInZoomControls(true);
    mMapController = mMapView.getController();

    mMyLocationOverlay = new CrashFixMyLocationOverlay(this, mMapView);
    mMapView.getOverlays().add(mMyLocationOverlay);

    mOverlay = new VenueItemizedOverlay(this.getResources().getDrawable(
            R.drawable.map_marker_blue));
}
 
开发者ID:vsvankhede,项目名称:foursquared.eclair,代码行数:12,代码来源:VenueMapActivity.java

示例11: onCreate

import com.google.android.maps.MapView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle icicle) {
	super.onCreate(icicle);

	if (!PropertyHolder.isInit())
		PropertyHolder.init(context);

	res = getResources();
	lang = Util.setDisplayLanguage(res);

	setContentView(R.layout.map_layout);

	this.setTitle(context.getResources().getString(
			R.string.activity_label_map));

	mapView = (MapView) findViewById(R.id.mapview);
	mapView.setBuiltInZoomControls(true);

	myMapController = mapView.getController();
	myMapController.setCenter(currentCenter != null ? currentCenter
			: Util.CEAB_COORDINATES);
	myMapController.setZoom(15);
	satToggle = false;
	mapView.setSatellite(satToggle);

	// pauseToggle = !PropertyHolder.isServiceOn();

	mPoints = new ArrayList<GeoPoint>();
	mOverlaylist = new ArrayList<MyOverlayItem>();

	progressbar = (ProgressBar) findViewById(R.id.mapProgressbar);
	progressbar.setProgress(0);

	adultMarker = new MarkerDrawable(context, ADULT_COLOR);
	siteMarker = new MarkerDrawable(context, SITE_COLOR);

}
 
开发者ID:MoveLab,项目名称:tigatrapp-android,代码行数:38,代码来源:MapData.java

示例12: onCreate

import com.google.android.maps.MapView; //导入方法依赖的package包/类
/** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.main);
     MapView mapView = (MapView) findViewById(R.id.mapview);
     mapView.setBuiltInZoomControls(true);
     List<Overlay> mapOverlays = mapView.getOverlays();
     Drawable drawable = this.getResources().getDrawable(R.drawable.test);
     TestOverlay itemizedoverlay = new TestOverlay(drawable, this);
     DataBaseHelper myDbHelper = new DataBaseHelper(this.getApplicationContext());
     myDbHelper = new DataBaseHelper(this);

     try {

     	myDbHelper.createDataBase();

} catch (IOException ioe) {

	throw new Error("Unable to create database");

}

try {

	myDbHelper.openDataBase();

}catch(SQLException sqle){

	throw sqle;

}
     Stop[] s = Stop.getAllStops();
	for (int x = 0; x < s.length; x++)
		itemizedoverlay.addOverlay(new BusStop(s[x]));
     mapOverlays.add(itemizedoverlay);
 }
 
开发者ID:busradar,项目名称:busradar,代码行数:38,代码来源:Maptest.java

示例13: initMap

import com.google.android.maps.MapView; //导入方法依赖的package包/类
protected void initMap() {
       setDefaultKeyMode(DEFAULT_KEYS_SHORTCUT);

       setContentView(R.layout.proximity_alert_view);
       mapView = (MapView)findViewById(R.id.map_view);
       mapController = mapView.getController();

	mapView.setBuiltInZoomControls(true);
}
 
开发者ID:SpencerRiddering,项目名称:flingtap-done,代码行数:10,代码来源:NearminderViewer.java

示例14: onCreate

import com.google.android.maps.MapView; //导入方法依赖的package包/类
public void onCreate(Bundle bundle) {
	super.onCreate(bundle);
	setContentView(R.layout.main); // bind the layout to the activity

	// Configure the Map
	mapView = (MapView) findViewById(R.id.mapview);
	mapView.setBuiltInZoomControls(true);
	mapView.setSatellite(true);
	mapController = mapView.getController();
	mapController.setZoom(14); // Zoon 1 is world view
	locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
	locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0,
			0, new GeoUpdateHandler());

	myLocationOverlay = new MyLocationOverlay(this, mapView);
	mapView.getOverlays().add(myLocationOverlay);

	myLocationOverlay.runOnFirstFix(new Runnable() {
		public void run() {
			mapView.getController().animateTo(
					myLocationOverlay.getMyLocation());
		}
	});

	Drawable drawable = this.getResources().getDrawable(R.drawable.point);
	itemizedoverlay = new MyOverlays(this, drawable);
	createMarker();
}
 
开发者ID:vogellacompany,项目名称:codeexamples-android,代码行数:29,代码来源:ShowMapActivity.java

示例15: onCreateView

import com.google.android.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
		Bundle savedInstanceState) {
	ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_map,
			null);

	mMapView = (MapView) root.findViewById(R.id.mapview);
	mMapView.setBuiltInZoomControls(true);
	mMapView.setSatellite(mSatellite);
	mOverlays = mMapView.getOverlays();
	mOverlays.add(new MetropolisOverlay());

	mLevel0 = (Button) root.findViewById(R.id.level0);
	mLevel1 = (Button) root.findViewById(R.id.level1);
	mLevel0.setSelected(mLevel == 0);
	mLevel1.setSelected(mLevel == 1);
	mLevel0.setOnClickListener(mLevelClickListener);
	mLevel1.setOnClickListener(mLevelClickListener);

	Button satelliteBtn = (Button) root.findViewById(R.id.satellite);
	satelliteBtn.setSelected(mSatellite);
	satelliteBtn.setOnClickListener(mSatteliteClickListener);

	mMapController = mMapView.getController();
	mMapController.setCenter(METROPOLIS_GEOPOINT);
	mMapController.setZoom(19);

	return root;
}
 
开发者ID:devoxx,项目名称:mobile-client,代码行数:30,代码来源:MapFragment.java


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