[問題] 隧道內或地下室定位?
大家好,
我寫了一支程式去紀錄定位座標,
因有考量到GPS無法定位問題,
因此我有使用GPS_Provider與Network_Provider.
程式如下:
Location location=null;
locationMgr = (LocationManager)
(ctx.getSystemService(Context.LOCATION_SERVICE));
isGPSEnabled = locationMgr.isProviderEnabled(LocationManager.GPS_PROVIDER);
isNetworkEnabled =
locationMgr.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
if (isGPSEnabled || isNetworkEnabled) {
//若GPS有效則以GPS優先
if (isGPSEnabled) {
if (location == null) {
locationMgr.requestLocationUpdates(LocationManager.GPS_PROVIDER,..略);
if (locationMgr != null) {
location = locationMgr.getLastKnownLocation(LocationManager.
GPS_PROVIDER);
}
}
}
//若GPS無效,則以網路定位
if (isNetworkEnabled) {
if(location == null){
locationMgr.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,.略);
if (locationMgr != null) {
location = locationMgr.getLastKnownLocation(LocationManager.
NETWORK_PROVIDER);
}
}
}
}
但我在捷運隧道測試時我的程式卻定不到位,
但是Google Map若可以!!
請問有人知道原因嗎?
謝謝!
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.136.12.24
※ 文章網址: http://www.ptt.cc/bbs/AndroidDev/M.1410705925.A.B41.html
→
09/18 15:02, , 1F
09/18 15:02, 1F
推
09/18 22:53, , 2F
09/18 22:53, 2F
→
09/18 22:54, , 3F
09/18 22:54, 3F
→
09/19 00:32, , 4F
09/19 00:32, 4F
推
09/19 01:37, , 5F
09/19 01:37, 5F
→
09/19 01:39, , 6F
09/19 01:39, 6F