當前位置: 首頁>>代碼示例>>Java>>正文


Java MapView.setBuiltInZoomControls方法代碼示例

本文整理匯總了Java中com.baidu.mapapi.map.MapView.setBuiltInZoomControls方法的典型用法代碼示例。如果您正苦於以下問題:Java MapView.setBuiltInZoomControls方法的具體用法?Java MapView.setBuiltInZoomControls怎麽用?Java MapView.setBuiltInZoomControls使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.baidu.mapapi.map.MapView的用法示例。


在下文中一共展示了MapView.setBuiltInZoomControls方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initMap

import com.baidu.mapapi.map.MapView; //導入方法依賴的package包/類
/**
 * 初始化地圖
 */
private void initMap() {
    //設置MapView
    mMapView = (MapView)findViewById(R.id.bmapsView);
    mMapView.setBuiltInZoomControls(true);                      //設置啟用內置的縮放控件
    mMapView.showScaleControl(true);                            //顯示比例尺
    
    //地圖控製器
    mMapController = mMapView.getController();
    
    //我的位置
    myLocationOverlay = new MyLocationOverlay(mMapView);
    
    //設置彈出窗
    mPopWindow = new PopupOverlay(mMapView, new MyPopupClickListener());
}
 
開發者ID:alexcaisenchuan,項目名稱:FunWeibo,代碼行數:19,代碼來源:BaiduMapActivity.java

示例2: onCreate

import com.baidu.mapapi.map.MapView; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	instance = this;
	// Gl app = (Gl)this.getApplication();
	if (mBMapManager == null) {
		initEngineManager(this.getApplicationContext());
	}
	setContentView(R.layout.activity_baidumap);
	mMapView = (MapView) findViewById(R.id.bmapView);
	mMapController = mMapView.getController();
	sendButton = (Button) findViewById(R.id.btn_location_send);
	initMapView();

	mMapView.getController().setZoom(17);
	mMapView.getController().enableClick(true);
	mMapView.setBuiltInZoomControls(true);
	Intent intent = getIntent();
	double latitude = intent.getDoubleExtra("latitude", 0);
	if (latitude == 0) {
		showMapWithLocationClient();
	} else {
		double longtitude = intent.getDoubleExtra("longitude", 0);
		String address = intent.getStringExtra("address");
		showMap(latitude, longtitude, address);
	}
}
 
開發者ID:macyuan,項目名稱:TAG,代碼行數:28,代碼來源:BaiduMapActivity.java

示例3: onCreate

import com.baidu.mapapi.map.MapView; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	userInfo = this.getSharedPreferences("setting", Context.MODE_PRIVATE);
	global = Global.getInstance(userInfo.getString("dm_user", ""));
	//����SharedPreferences
	this.rwInfo=this.getSharedPreferences(this.getIntent().getIntExtra("rw_dm", 0)+"", Context.MODE_PRIVATE);
	setContentView(R.layout.activity_get_lbs_tab);

	// ��ͼ��ʼ��
	mMapView = (MapView) findViewById(R.id.bmapsView);
	mMapController = mMapView.getController();
	mMapView.getController().setZoom(18);
	mMapView.getController().enableClick(true);
	mMapView.setBuiltInZoomControls(true);
	// ���� ��������ͼ��
	createPaopao();

	// ��λ��ʼ��
	mLocClient = new LocationClient(this);
	locData = new LocationData();
	mLocClient.registerLocationListener(myListener);
	mLocClient.setAK(Utils.getMetaValue(getApplication(), "map_api_key"));
	LocationClientOption option = new LocationClientOption();
	option.setOpenGps(true);// ��gps
	option.setCoorType("bd09ll"); // ������������
	option.setScanSpan(1000);
	option.setAddrType("all");
	mLocClient.setLocOption(option);
	mLocClient.start();
	// ��λͼ���ʼ��
	myLocationOverlay = new locationOverlay(mMapView);
	// ���ö�λ����
	myLocationOverlay.setData(locData);
	// ��Ӷ�λͼ��
	mMapView.getOverlays().add(myLocationOverlay);
	myLocationOverlay.enableCompass();
	// �޸Ķ�λ���ݺ�ˢ��ͼ����Ч
	mMapView.refresh();
}
 
開發者ID:liufeiit,項目名稱:itmarry,代碼行數:41,代碼來源:GetLbsTab.java

示例4: mapView

import com.baidu.mapapi.map.MapView; //導入方法依賴的package包/類
public void mapView() {
    mMapView = (MapView)findViewById(R.id.bmapsView);  

    mMapView.setBuiltInZoomControls(true);  
    //設置啟用內置的縮放控件  
    MapController mMapController = mMapView.getController();  
    // 得到mMapView的控製權,可以用它控製和驅動平移和縮放  
    GeoPoint point = new GeoPoint((int)(39.915* 1E6),(int)(116.404* 1E6));  
    //用給定的經緯度構造一個GeoPoint,單位是微度 (度 * 1E6)  
    mMapController.setCenter(point);//設置地圖中心點  
    mMapController.setZoom(18);//設置地圖zoom級別
}
 
開發者ID:townboy,項目名稱:calltaxi,代碼行數:13,代碼來源:MapActivity.java

示例5: onCreate

import com.baidu.mapapi.map.MapView; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	// 初始化
	initEngineManager(this);

	// 布局獲取ID
	setContentView(R.layout.pyp_page_map);
	mMapView = (MapView) findViewById(R.id.bmapView);

	mMapView.setBuiltInZoomControls(true);
	mMapController = mMapView.getController();		
	GeoPoint point = new GeoPoint(APPCodeConst.Y_pyp, APPCodeConst.X_pyp);// 設置地圖中心
	mMapController.setCenter(point);
	mMapController.setZoom(18);//放大級數
       mMapController.enableClick(true);						//設置地圖是否響應點擊事件  .
       
       //實例化監聽事件
       mMapView.regMapViewListener(mBMapManager, mMapListener);
       mMapView.regMapTouchListner(mapTouchListener);
       
       if(satellite == true){                                                 //設置衛星圖顯示
       	mMapView.setSatellite(true);
       }else{
       	mMapView.setSatellite(false);
       }
}
 
開發者ID:steven2947,項目名稱:NeXT_pyp,代碼行數:29,代碼來源:BMapActivity.java

示例6: onCreate

import com.baidu.mapapi.map.MapView; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Must be initialized before setContentView
    mBMapMan = new BMapManager(getApplication());
    mBMapMan.init(BAIDU_MAPS_KEY, this);

    setContentView(R.layout.venue_activity);

    initSearchText();
    initActionBar();

    mMapView = (MapView) findViewById(R.id.mapView);
    mMapView.setBuiltInZoomControls(ZOOM_CONTROLS_ENABLED);

    MapController mMapController = mMapView.getController();
    mMapController.setCenter(DEFAULT_LOCATION_BEIJING);
    mMapController.setZoom(DEFAULT_ZOOM_LEVEL);

    if (getIntent().getExtras() != null) {

        final String shareId = getIntent().getExtras().getString("shareId");

        mShare = ReadShare.requestShare(shareId, this);
    } else {
        mShare = WriteShare.initNewShare();
    }

    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    mFragment = VenueListFragment.newInstance();
    ft.replace(R.id.venueFragmentContainer, mFragment);
    ft.commit();

    setupLocationClient();
    setupLocationManager();
    // Tiananmen Square coords
    mSearchHelper = new VenueSearchHelper(mFragment, 39.915, 116.404);
}
 
開發者ID:cuipengpeng,項目名稱:p1-android,代碼行數:40,代碼來源:VenueActivity.java

示例7: onCreate

import com.baidu.mapapi.map.MapView; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_tab_map);

	mMapView = (MapView) findViewById(R.id.bmapsView);
	mMapView.setBuiltInZoomControls(true);
	// mMapView.setSatellite(true);
	// �����������õ����ſؼ�
	mMapController = mMapView.getController();
	// �õ�mMapView�Ŀ���Ȩ,�����������ƺ�����ƽ�ƺ�����
	locData = new LocationData();
	locData.direction = 2.0f;

	Intent intent = this.getIntent();
	this.jd=intent.getDoubleExtra("jd", 0);
	this.wd=intent.getDoubleExtra("wd", 0);

	// ��ȡ���������
	Log.d("wd", jd + "");
	Log.d("jd", wd + "");
	locData.latitude = wd;
	locData.longitude = jd;
	myLocationOverlay = new MyLocationOverlay(mMapView);

	myLocationOverlay.setData(locData);
	GeoPoint point = new GeoPoint((int) (locData.latitude * 1e6),
			(int) (locData.longitude * 1e6));
	// �ø����ľ�γ�ȹ���һ��GeoPoint����λ��΢�� (�� * 1E6)
	mMapController.setCenter(point);// ���õ�ͼ���ĵ�
	mMapController.setZoom(18);// ���õ�ͼzoom����
	mMapView.getOverlays().add(myLocationOverlay);
	mMapView.refresh();
	mMapView.getController().animateTo(point);

	// ��ʼ��ȡ��ǰλ������
	
	mLocClient = new LocationClient(this);
	mLocClient.registerLocationListener(myListener);
	mLocClient.setAK(Utils.getMetaValue(getApplication(), "map_api_key"));
	LocationClientOption option = new LocationClientOption();
	option.setOpenGps(true);// ��gps
	option.setCoorType("bd09ll"); // ������������
	option.setScanSpan(1000);
	option.setAddrType("all");
	mLocClient.setLocOption(option);
	
	mLocClient.start();
}
 
開發者ID:liufeiit,項目名稱:itmarry,代碼行數:50,代碼來源:LjghTab.java

示例8: onCreate

import com.baidu.mapapi.map.MapView; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	userInfo = this.getSharedPreferences("setting", Context.MODE_PRIVATE);
	global = Global.getInstance(userInfo.getString("dm_user", ""));
	// ����SharedPreferences
	this.rwInfo = this.getSharedPreferences(
			this.getIntent().getIntExtra("rw_dm", 0) + "",
			Context.MODE_PRIVATE);
	setContentView(R.layout.activity_get_lbs_tab);

	// ��ͼ��ʼ��
	mMapView = (MapView) findViewById(R.id.bmapsView);
	mMapController = mMapView.getController();
	mMapView.getController().setZoom(18);
	mMapView.getController().enableClick(true);
	mMapView.setBuiltInZoomControls(true);
	// ���� ��������ͼ��
	createPaopao();

	// ��λ��ʼ��
	mLocClient = new LocationClient(this);
	locData = new LocationData();
	mLocClient.registerLocationListener(myListener);
	mLocClient.setAK(Utils.getMetaValue(getApplication(), "map_api_key"));
	LocationClientOption option = new LocationClientOption();
	option.setOpenGps(true);// ��gps
	option.setCoorType("bd09ll"); // ������������
	option.setScanSpan(1000);
	option.setAddrType("all");
	mLocClient.setLocOption(option);
	mLocClient.start();
	// ��λͼ���ʼ��
	myLocationOverlay = new locationOverlay(mMapView);
	// ���ö�λ����
	myLocationOverlay.setData(locData);
	// ��Ӷ�λͼ��
	mMapView.getOverlays().add(myLocationOverlay);
	myLocationOverlay.enableCompass();
	// �޸Ķ�λ���ݺ�ˢ��ͼ����Ч
	mMapView.refresh();
}
 
開發者ID:liufeiit,項目名稱:itmarry,代碼行數:43,代碼來源:DaoHangTab.java


注:本文中的com.baidu.mapapi.map.MapView.setBuiltInZoomControls方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。