導航:首頁 > 操作系統 > android百度地圖中心點坐標

android百度地圖中心點坐標

發布時間:2024-10-13 09:56:51

1. 怎麼看百度地圖自己的位置在哪呢

演示機型:vivo s7
系統版本:android 10
軟體版本:網路地圖 15.8.0.1080
當處在一個陌生的地方,不知道自己的位置在哪,可以使用網路地圖查看,具體操作如下:
1.打開網路地圖app。
2.進入地圖的界面後,會看到地圖頁面上有一個藍色的游標,這就是地圖定位的位置了。
3.放大地圖,可以看到一個大概位置。
4.點擊「周邊」。
5.點擊頂部倒三角符號,可以看到「當前位置」,顯示的位置就是你所在的位置了。
總結:首先打開網路地圖app,進入到地圖界面後,放大地圖,可以看到一個大概位置,然後點擊「周邊」,最後點擊倒三角符號就可以看到當前位置了。

2. 怎麼在android百度地圖通過經緯度來定位並且顯示出地圖位置

可以參考如下內容:

使用Android自帶的LocationManager和Location獲取位置的時候,經常會有獲取的location為null的情況,並且操作起來也不是很方便,在這個Demo里我使用了網路地圖API中的定位SDK,可以一次性獲取當前位置經緯度以及詳細地址信息,還可以獲取周邊POI信息,同時可以設定位置通知點,當到達某一位置時,發出通知信息等方式來告知用戶。jar包下載以及官方文檔請參照:網路定位SDK,前提是需要注冊網路開發者賬號。
下面來看看定位的基本原理,目前,定位SDK可以通過GPS、基站、Wifi信號進行定位。基本定位流程如下圖所示,當應用程序向定位SDK發起定位請求時,定位SDK會根據當前的GPS、基站、Wifi信息生成相對應的定位依據。然後定位SDK會根據定位依據來進行定位。如果需要,定位SDK會向定位伺服器發送網路請求。定位伺服器會根據請求的定位依據推算出對應的坐標位置,然後根據用戶的定製信息,生成定位結果返回給定位SDK。

3. 百度android地圖怎麼獲取當前屏幕中心點的坐標

true]GeoPoint centerPoint = mapview.getMapCenter();// 地圖中心坐標 int tbSpan = mapview.getLatitudeSpan();// 當前緯線的跨度(從地圖的上邊緣到下邊緣) int lrSpan = mapview.getLongitudeSpan();// 當前經度的跨度(從地圖的左邊緣到地圖的右邊緣) GeoPoint ltPoint = new GeoPoint(centerPoint.getLatitudeE6() - tbSpan / 2, centerPoint.getLongitudeE6() - lrSpan / 2);// 左上角坐標 GeoPoint rbPoint = new GeoPoint(centerPoint.getLatitudeE6() + tbSpan / 2, centerPoint.getLongitudeE6() + lrSpan / 2);// 右下角坐標 查看原帖>>

4. Android百度地圖,如何在百度地圖顯示在手機屏幕上的部分,獲取到中心點

java">privateMapViewmMapView;
privateBaiMapmBaiMap;
MapStatusmmapStatus;
mmapStatus=mBaiMap.getMapStatus();
LatLngcenter=mmapStatus.target;
Stringlocation=center.longitude+","+center.latitude;
System.out.println(location);
以上代碼輸出的location就是當前地圖屏幕的中心坐標;
舊的網路地圖SDK有一個方法,不過SDK升級後就沒有了,用上面的代碼就可以了

5. Android開發中百度地圖的定位為什麼總是北京,不是自己的位置

給,對照一下
可能的問題:1.用虛擬機,虛擬機定位就是在北京。
2.手機(或虛擬機)是否開啟了GPS功能

------------------------------
public class MainActivity extends AppCompatActivity {

MapView mMapView = null;
private BaiMap mBaiDuMap;
public LocationClient mLocationClient;
// public BDLocationListener myListener = new MyLocationListener();
public MyLocationListener myListener = new MyLocationListener();
private BitmapDescriptor mCurrentMarker;
private MyLocationConfiguration.LocationMode mCurrentMode;

// 經緯度
private TextView tvJingDu;
// 緯度
private TextView tvWeiDu;
// 高度
private TextView tvGaoDu;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SDKInitializer.initialize(getApplicationContext());
setContentView(R.layout.activity_main);

// 經緯度TextView 初始化
tvJingDu = (TextView) findViewById(R.id.tv_jing_);
tvWeiDu = (TextView) findViewById(R.id.tv_wei_);
tvGaoDu = (TextView) findViewById(R.id.tv_gao_);

//===================================
// 普通模式
mCurrentMode = MyLocationConfiguration.LocationMode.COMPASS;

// TODO
// mCurrentMarker = BitmapDescriptorFactory.fromResource(R.drawable.dingwei);
mCurrentMarker = null;

// 找到地圖控制項
mMapView = (MapView) findViewById(R.id.bmapView);
mBaiDuMap = mMapView.getMap();// 獲取地圖

mBaiDuMap.setMapType(BaiMap.MAP_TYPE_NORMAL);// 設置地圖模式為普通模式

// 開啟定點陣圖層
mBaiDuMap.setMyLocationEnabled(true);
mLocationClient = new LocationClient(this); // 定位用到一個類
mLocationClient.registerLocationListener(myListener);// 注冊監聽

// TODO
mBaiDuMap.setMyLocationConfigeration(new MyLocationConfiguration(
mCurrentMode, true, mCurrentMarker, R.color.myBlue, Color.YELLOW
));

// LocationClientOption類用來設置SDK的位置方式
LocationClientOption option = new LocationClientOption();//以下是給定位設置參數
option.setOpenGps(true); // 打開gps
option.setCoorType("bd09ll"); // 設置坐標類型
option.setScanSpan(2000);
mLocationClient.setLocOption(option);
mLocationClient.start();

}

boolean isFirstLoc = true; // 是否首次定位

// 3.網路位置監聽
public class MyLocationListener implements BDLocationListener {

@Override
public void onReceiveLocation(BDLocation location) {
Log.i("監聽被執行了", "監聽被執行了");

if (location == null || mMapView == null) {
return;
}

// // 定位結果
// StringBuffer sb = new StringBuffer(256);
// StringBuffer sb1 = new StringBuffer(256);
// StringBuffer sb2 = new StringBuffer(256);
// // 經度
// String jd = sb.append(location.getLongitude()).toString();
// tvJingDu.setText("" + jd);
// Log.i("經度", "" + jd);
// // 緯度
// String wd = sb1.append(location.getLatitude()).toString();
// tvWeiDu.setText("" + sb1);
// Log.i("緯度", "" + wd);
//
// String gao = sb.append(location.getAltitude()).toString();
// tvGaoDu.setText("" + gao);
// 經度
double d1 = location.getLongitude();
String s1 = "" + d1;
tvWeiDu.setText(s1);
Log.i("經度", "" + s1);
// 緯度
double d2 = location.getLatitude();
Log.i("TGA", "d2" + d2);
String s2 = "" + d2;
tvJingDu.setText(s2);
Log.i("緯度", "" + s2);

MyLocationData locData = new MyLocationData.Builder()
.accuracy(location.getRadius())
// 此處設置開發者獲取到的方向信息,順時針0-360
.direction(0).latitude(location.getLatitude())
.longitude(location.getLongitude()).build();
mBaiDuMap.setMyLocationData(locData);

if (isFirstLoc) {
isFirstLoc = false;
LatLng ll = new LatLng(location.getLatitude(),
location.getLongitude());
MapStatus.Builder builder = new MapStatus.Builder();
// 縮放的等級 12.0f
builder.target(ll).zoom(18.0f);
mBaiDuMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));
}
Log.i("MyLocationListener被執行了!", "onReceiveLocation");

}

@Override
public void onConnectHotSpotMessage(String s, int i) {

}
}

// 結束方法

@Override
protected void onDestroy() {
super.onDestroy();
mMapView.onDestroy();
}

@Override
protected void onResume() {
super.onResume();
mMapView.onResume();
}

@Override
protected void onPause() {
super.onPause();
mMapView.onPause();
}
}

6. Android調用百度地圖 設置了中心點 同時也定位 但是中心每次都是我的位置呢 坑

都說是定位,肯定是你自己的位置啊

閱讀全文

與android百度地圖中心點坐標相關的資料

熱點內容
linux創建一個文本 瀏覽:963
java基礎經典 瀏覽:944
mysql5用戶加密演算法 瀏覽:779
華為自帶鬧鍾app卸載了怎麼恢復 瀏覽:790
蘋果app怎麼都放大了 瀏覽:466
mill91編程教程下載 瀏覽:513
mc編程對比worknc 瀏覽:260
哪裡有人與動物的app 瀏覽:58
單片機累加器a 瀏覽:232
佛山雲伺服器分銷 瀏覽:473
java判斷是否為日期 瀏覽:319
安卓手機橙光賬號登錄長什麼樣 瀏覽:283
java編程思想好難 瀏覽:169
美的微清事業部決策規劃演算法專家 瀏覽:418
android百度地圖中心點坐標 瀏覽:691
乘除四則運演算法 瀏覽:352
如何破解伺服器驗證 瀏覽:686
linuxvnc使用 瀏覽:590
單片機怎麼新建c程序 瀏覽:497
去哪裡旅行app可以轉地方嗎 瀏覽:275