本文整理汇总了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);
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
});
}
示例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();
}
示例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();
}
}
示例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);
}
示例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));
}
示例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);
}
示例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();
}
示例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));
}
示例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);
}
示例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();
}
示例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;
}