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