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


Java MapView.displayZoomControls方法代码示例

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


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

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

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

示例3: 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"};
   
    }
 
开发者ID:busradar,项目名称:busradar,代码行数:74,代码来源:BusRadar.java

示例4: 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();
		
    }
 
开发者ID:busradar,项目名称:busradar,代码行数:55,代码来源:MapsActivity.java

示例5: 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);
  
   }
 
开发者ID:busradar,项目名称:busradar,代码行数:77,代码来源:BusRadar.java


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