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


Java MapView.getController方法代码示例

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


在下文中一共展示了MapView.getController方法的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) {
    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

示例3: onCreate

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

    // Create the MapView using my API key
    mapView = new MapView(this, getResources().getString(R.string.mapKey));
    mapView.setSatellite(true);
    mapView.setKeepScreenOn(true);

    // Add the map view to the map frame
    FrameLayout mapFrame = (FrameLayout) this.findViewById(R.id.MapFrame);
    mapFrame.addView(mapView);

    // Set the map controller
    mapController = mapView.getController();

    // Move the map view to the point
    mapController.setZoom(zoomLevel);
}
 
开发者ID:phishman3579,项目名称:android-openmap-framework,代码行数:24,代码来源:CustomMapActivity.java

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

		// create a map view
		RelativeLayout linearLayout = (RelativeLayout) findViewById(R.id.mainlayout);
		mapView = (MapView) findViewById(R.id.mapview);

//		ZoomControls mZoom = (ZoomControls) mapView.getZoomControls();
//		linearLayout.addView(mZoom);
		mapController = mapView.getController();
		// Zoon 1 is world view
		mapController.setZoom(14);
		locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
		locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0,
				0, new GeoUpdateHandler());

		overlays = mapView.getOverlays();
		Drawable drawable = this.getResources()
				.getDrawable(R.drawable.push_pin);
		itemizedoverlay = new MyOverlays(drawable);
		
	}
 
开发者ID:vogellacompany,项目名称:codeexamples-android,代码行数:24,代码来源:CurrentLocation.java

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

示例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);
    
    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

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

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

示例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);

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

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

示例11: onCreate

import com.google.android.maps.MapView; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Override
   public void onCreate(Bundle savedInstanceState)
   {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.main);
       
       mapView = (MapView) findViewById(R.id.mapView);
       mapView.setStreetView(true);
       mapView.setSatellite(true);
       LinearLayout zoomLayout = (LinearLayout)findViewById(R.id.zoom);  
       View zoomView = mapView.getZoomControls();

       zoomLayout.addView(zoomView, 
           new LinearLayout.LayoutParams(
               LayoutParams.WRAP_CONTENT, 
               LayoutParams.WRAP_CONTENT)); 
       mapView.displayZoomControls(true);
       
       mc = mapView.getController();
       String coordinates[] = {"43.067874", "-89.40936"};
       double lat = Double.parseDouble(coordinates[0]);
       double lng = Double.parseDouble(coordinates[1]);
       
       p = new GeoPoint(
               (int) (lat * 1E6), 
               (int) (lng * 1E6));
    
       mc.animateTo(p);
       mc.setZoom(17); 
       
       //---Add a location marker---
       MapOverlay mapOverlay = new MapOverlay();
       List<Overlay> listOfOverlays = mapView.getOverlays();
       listOfOverlays.clear();
       listOfOverlays.add(mapOverlay); 
       
       mapView.invalidate();
   }
 
开发者ID:busradar,项目名称:busradar,代码行数:40,代码来源:MapsActivity.java

示例12: initMap

import com.google.android.maps.MapView; //导入方法依赖的package包/类
protected void initMap(){
	setDefaultKeyMode(DEFAULT_KEYS_SHORTCUT);
	
	setContentView(R.layout.select_area);
	mapView = (MapView)findViewById(R.id.map_view);		
	mapController = mapView.getController();
	
	// Add zoom controls.
    LinearLayout zoomLayout = (LinearLayout) findViewById(R.id.map_zoom);
    zoomLayout.addView(mapView.getZoomControls(),
        new ViewGroup.LayoutParams(LayoutParams.WRAP_CONTENT,
            LayoutParams.WRAP_CONTENT));		

}
 
开发者ID:SpencerRiddering,项目名称:flingtap-done,代码行数:15,代码来源:SelectAreaActivity.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: AnimatedMapZoomer

import com.google.android.maps.MapView; //导入方法依赖的package包/类
public AnimatedMapZoomer(MapView mapView, Handler handler, int targetLatSpan, int targetLongSpan, long time) {
	this.targetLatSpan = targetLatSpan;
	this.targetLongSpan = targetLongSpan;
	this.mapView = mapView;
	this.mapController = mapView.getController();

	this.startLatSpan = mapView.getLatitudeSpan();
	this.startLongSpan = mapView.getLongitudeSpan();
	this.time = time;
	this.handler = handler;
}
 
开发者ID:Mapyst,项目名称:Mapyst,代码行数:12,代码来源:AnimatedMapZoomer.java


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