v2에는 이를 어떻게 구현해야할지 모르겠군요..
public void GetLocations() {
Log.d("location", "========================GetLocations===========================");
// 텍스트뷰를 찾음
TextView latText = (TextView) findViewById(R.id.tvLatitude);
TextView lngText = (TextView) findViewById(R.id.tvLongitude);
TextView speedText = (TextView) findViewById(R.id.tvSpeed);
TextView jusoText = (TextView) findViewById(R.id.tvAddress);
StringBuffer juso = new StringBuffer();
if (myLocation != null) {
Log.d("location", "========================GetLocations!!!===========================");
latPoint = myLocation.getLatitude();
lngPoint = myLocation.getLongitude();
speed = (float) (myLocation.getSpeed() * 3.6);
// dou_lat = myLocation.getLatitude();
// dou_lng = myLocation.getLongitude();
Toast.makeText(blackbox.this, "위도 : " + dou_lat + " 경도: " + dou_lng , Toast.LENGTH_SHORT).show();
LatLng latlng = new LatLng(latPoint, lngPoint);
CameraPosition cp = new CameraPosition.Builder().target((latlng)).zoom(15).build();
map.animateCamera(CameraUpdateFactory.newCameraPosition(cp)); // 지정위치로 이동
try {
// 위도,경도를 이용하여 현재 위치의 주소를 가져온다.
List<Address> addresses;
addresses = geoCoder.getFromLocation(latPoint, lngPoint, 1);
for (Address addr : addresses) {
int index = addr.getMaxAddressLineIndex();
for (int i = 0; i <= index; i++) {
juso.append(addr.getAddressLine(i));
juso.append(" ");
Log.d("location", "button pressed");
}
juso.append("\n");
}
} catch (IOException e) {
e.printStackTrace();
}
}
latText.setText(String.valueOf(latPoint));
lngText.setText(String.valueOf(lngPoint));
speedText.setText(String.valueOf(speed));
jusoText.setText(String.valueOf(juso));
}