Google지도를 사용하여 이클립스에서 Android 용 애플리케이션을 개발했습니다. 문제는 내 현재 위치를 나타내는 파란색 점이 도시 외부의 도로에서 운전중인 도로와 항상 평행하게 나타나는 것입니다. 그러나 만일 당신이 도시의 내부에 있으면, 길의 꼭대기에 벌써있다.내 위치가 길 밖으로 나옵니다. Google map 이클립스
내가 응용 프로그램의 시작에 내 위치를 얻기 위해 이것을 사용하고 있습니다 :
googleMap.setMyLocationEnabled(true);
을 한 후 나는 대기를 시작합니다
locationManager = (LocationManager) getActivity().getSystemService(Context.LOCATION_SERVICE);
Criteria criteria = new Criteria();
Location myLocation = locationManager.getLastKnownLocation(locationManager.getBestProvider(criteria, false));
가 나는지도에 파란색 점을 추가 위치 변경 :
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, time, 1, this);
내 위치 변경 기능 :
,@Override
public void onLocationChanged(Location location) {
if (location != null) {
Lat1 = location.getLatitude();
Long1 = location.getLongitude();
if (Lat1 != Lat || Long1 != Long) {
Lat = location.getLatitude();
Long = location.getLongitude();
if (startNav == true) {
googleMap.animateCamera(CameraUpdateFactory
.newLatLngZoom(new LatLng(location.getLatitude(), location.getLongitude()), 17));
b = new LatLng(Lat, Long);
if (a != null) {
String urlTopass = makeURL(b.latitude, b.longitude, a.latitude, a.longitude);
new connectAsyncTask(urlTopass).execute();
}
}
}
}
}
나의 질문은 왜 푸른 색 점이 길 위에 평행하게 보이지 않는가?