Eclipse를 사용 중이며 일부 메소드가 GoogleMaps 객체에 표시되지 않습니다.GoogleMap 유형에 대해 getMap.setpadding()이 정의되지 않았습니다.
google-play-services_lib을 가져 왔으며 Google Play 서비스의 최신 버전이 있고 최신 API (버전 4.4.2 (API 19))를 실행하고 있는지 확인했으며 모두 제거했습니다. Map Fragment는 내 테스트 장치에서 잘 작동하지만 .setPadding()과 같은 메소드를 구현하려고하면 .setpadding이 GoogleMap 객체에 대해 정의되지 않은 오류가 발생합니다.
여기 : https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/GoogleMap#setPadding(int, int, int, int)
아이디어가 있으십니까?
공용 클래스 MapDemo는 활동 LocationListener를 구현 확장 {
GoogleMap googleMap;
GoogleMapOptions options = new GoogleMapOptions();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mapdemo);
try {
initilizeMap();
} catch (Exception e) {
Log.e("ERROR", "ERROR IN CODE: " + e.toString());
e.printStackTrace();
}
}
private void initilizeMap() {
// Do a null check to confirm that we have not already instantiated the
// map.
if (googleMap == null) {
googleMap = ((MapFragment) getFragmentManager().findFragmentById(
R.id.map)).getMap();
googleMap.setMyLocationEnabled(true);
googleMap.setPadding(0,0,30,0); // **<--This method does not appear to be in the API!**
// Check if we were successful in obtaining the map.
if (googleMap != null) {
// The Map is verified. It is now safe to manipulate the map.
options.mapType(GoogleMap.MAP_TYPE_HYBRID)
.compassEnabled(false) .rotateGesturesEnabled(false)
.tiltGesturesEnabled(false) ;
} else {
Toast.makeText(getApplicationContext(),
"Sorry! unable to create maps", Toast.LENGTH_SHORT)
.show();
}
}
}