本文整理汇总了Java中com.google.android.maps.MapView.setSatellite方法的典型用法代码示例。如果您正苦于以下问题:Java MapView.setSatellite方法的具体用法?Java MapView.setSatellite怎么用?Java MapView.setSatellite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.maps.MapView
的用法示例。
在下文中一共展示了MapView.setSatellite方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: onCreate
import com.google.android.maps.MapView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mImageManager = ImageManager.getInstance(this);
FrameLayout frame = (FrameLayout) findViewById(R.id.frame);
Button goButton = (Button) findViewById(R.id.go);
goButton.setOnClickListener(this);
// Add the map view to the frame
mMapView = new MapView(this, "Panoramio_DummyAPIKey");
frame.addView(mMapView,
new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
// Create an overlay to show current location
mMyLocationOverlay = new MyLocationOverlay(this, mMapView);
mMyLocationOverlay.runOnFirstFix(new Runnable() { public void run() {
mMapView.getController().animateTo(mMyLocationOverlay.getMyLocation());
}});
mMapView.getOverlays().add(mMyLocationOverlay);
mMapView.getController().setZoom(15);
mMapView.setClickable(true);
mMapView.setEnabled(true);
mMapView.setSatellite(true);
addZoomControls(frame);
}
示例3: 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);
}
示例4: 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();
}
示例5: 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();
}
示例6: 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;
}
示例7: onCreate
import com.google.android.maps.MapView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FrameLayout frame = new FrameLayout(this);
mMapView = new MapView(this, "MapViewCompassDemo_DummyAPIKey");
frame.addView(mMapView,
new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
setContentView(frame);
mMyLocationOverlay = new MyLocationOverlay(this, mMapView);
mMarker = getResources().getDrawable(R.drawable.map_pin);
// Make sure to give mMarker bounds so it will draw in the overlay
final int intrinsicWidth = mMarker.getIntrinsicWidth();
final int intrinsicHeight = mMarker.getIntrinsicHeight();
mMarker.setBounds(0, 0, intrinsicWidth, intrinsicHeight);
mMarkerXOffset = -(intrinsicWidth / 2);
mMarkerYOffset = -intrinsicHeight;
// Read the item we are displaying from the intent, along with the
// parameters used to set up the map
Intent i = getIntent();
mItem = i.getParcelableExtra(ImageManager.PANORAMIO_ITEM_EXTRA);
int mapZoom = i.getIntExtra(ImageManager.ZOOM_EXTRA, Integer.MIN_VALUE);
int mapLatitudeE6 = i.getIntExtra(ImageManager.LATITUDE_E6_EXTRA, Integer.MIN_VALUE);
int mapLongitudeE6 = i.getIntExtra(ImageManager.LONGITUDE_E6_EXTRA, Integer.MIN_VALUE);
final List<Overlay> overlays = mMapView.getOverlays();
overlays.add(mMyLocationOverlay);
overlays.add(new PanoramioOverlay());
final MapController controller = mMapView.getController();
if (mapZoom != Integer.MIN_VALUE && mapLatitudeE6 != Integer.MIN_VALUE
&& mapLongitudeE6 != Integer.MIN_VALUE) {
controller.setZoom(mapZoom);
controller.setCenter(new GeoPoint(mapLatitudeE6, mapLongitudeE6));
} else {
controller.setZoom(15);
mMyLocationOverlay.runOnFirstFix(new Runnable() {
public void run() {
controller.animateTo(mMyLocationOverlay.getMyLocation());
}
});
}
mMapView.setClickable(true);
mMapView.setEnabled(true);
mMapView.setSatellite(true);
addZoomControls(frame);
}
示例8: 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_selector_dialog);
Bundle b = getIntent().getExtras();
if (b.containsKey(Messages.makeIntentExtraKey(context,
ReportTool.PREVIOUS_LAT))) {
previous_lat = b.getFloat(Messages.makeIntentExtraKey(context,
ReportTool.PREVIOUS_LAT)) * 1E6;
}
if (b.containsKey(Messages.makeIntentExtraKey(context,
ReportTool.PREVIOUS_LON))) {
previous_lon = b.getFloat(Messages.makeIntentExtraKey(context,
ReportTool.PREVIOUS_LON)) * 1E6;
}
mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
satToggle = true;
mapView.setSatellite(satToggle);
myMapController = mapView.getController();
if (previous_lat != null && previous_lon != null) {
selectedPoint = new GeoPoint(previous_lat.intValue(),
previous_lon.intValue());
myMapController.setCenter(selectedPoint);
} else
myMapController.setCenter(Util.CEAB_COORDINATES);
myMapController.setZoom(15);
mOKB = (Button) findViewById(R.id.selectWhereOk);
mCancelB = (Button) findViewById(R.id.selectWhereCancel);
}
示例9: onCreate
import com.google.android.maps.MapView; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
try {
Log.i("XXXXXXXXXXXXX", "hello");
for (String s : getAssets().list(""))
Log.i("XXXXXXXXXXXXX", s);
//InputStream f = getAssets().open("bus");
AssetFileDescriptor f = getAssets().openFd("routes.sqlite.jet");
// Log.i("XXXXXXXXXXXXX", String.format("exists %s\n",f.exists()));
if (true)
return;
}
catch(Exception e) { throw new RuntimeException(e); }
setContentView(R.layout.main);
mapView = (MapView) findViewById(R.id.mapView);
mapView.setStreetView(false);
mapView.setSatellite(false);
// ZOOM CONTROL
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();
//INIT DB
//getResources().openRawResourceFd(R.)
//PULL BUS STOPS FROM DB
// Cursor select = db.rawQuery("SELECT id, lat, long, dir FROM routes", null);
// select.moveToFirst();
// BusStop[] stops = new BusStop[select.getCount()];
// for (int x = 0; x < stops.length; x++)
// {
// //middle two was originally double
// stops[x] = new BusStop(select.getInt(0), select.getInt(1), select.getString(2).charAt(0), select.getInt(3));
// select.moveToNext();
// }
// select.close();
// GPS
lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
locationListener = new MyLocationListener();
// lm.requestLocationUpdates(
// LocationManager.GPS_PROVIDER,
// 0,
// 0,
// locationListener);
//String nearCSbuilding = {"43.067874", "-89.40936"};
//String nearHospital[] = {"43.078846", "-89.430023"};
}
示例10: onCreate
import com.google.android.maps.MapView; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//---use the LocationManager class to obtain GPS locations---
lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
locationListener = new MyLocationListener();
lm.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
0,
0,
locationListener);
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();
}
示例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(false);
mapView.setSatellite(false);
// ZOOM CONTROL
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);
// SAT VIEW
Button s = (Button) findViewById(R.id.sat);
s.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
toggleSatellite();
}
});
mc = mapView.getController();
//INIT DB
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;
}
//PULL BUS STOPS FROM DB
stops = Stop.getAllStops();
StopOverlay itemizedOverlay = new StopOverlay(stops, this);
listOfOverlays = mapView.getOverlays();
listOfOverlays.clear();
listOfOverlays.add(itemizedOverlay);
// MyLocationOverlay
MyLocationOverlay myLocationOverlay = new MyLocationOverlay(this, mapView);
listOfOverlays.add(myLocationOverlay);
myLocationOverlay.enableMyLocation();
// GPS
lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
// Set the criteria for selection a location provider
criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE);
criteria.setAltitudeRequired(false);
criteria.setBearingRequired(false);
criteria.setCostAllowed(true);
criteria.setPowerRequirement(Criteria.POWER_LOW);
}