本文整理汇总了Java中com.baidu.mapapi.map.MapView.getController方法的典型用法代码示例。如果您正苦于以下问题:Java MapView.getController方法的具体用法?Java MapView.getController怎么用?Java MapView.getController使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.baidu.mapapi.map.MapView
的用法示例。
在下文中一共展示了MapView.getController方法的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());
}
示例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);
}
}
示例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();
}
示例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级别
}
示例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);
}
}
示例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);
}
示例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();
}
示例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();
}