-
[(?)헛소리] 안드로이드2011.05.12 PM 12:07
package kim.doowon.goomap;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
public class GoomapActivity extends MapActivity {
/** Called when the activity is first created. */
// 지도의 초기값
double lat = 37.565263;//서울의 위도
double lng = 126.980667;//서울의 경도
static final int INITIAL_ZOOM_LEVEL = 15;
MapView map_View;
MapController controller;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
map_View = (MapView)findViewById(R.id.mapview);
map_View.setSatellite(true);
map_View.setStreetView(true);
map_View.displayZoomControls(false);
map_View.setBuiltInZoomControls(true);
controller = map_View.getController();
GeoPoint point =new GeoPoint(
(int)(lat*1E6), //위도
(int)(lng*1E6)); //경도
controller.animateTo(point);
controller.setZoom(INITIAL_ZOOM_LEVEL);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// TODO Auto-generated method stub
if(keyCode == KeyEvent.KEYCODE_S){
map_View.setSatellite(!map_View.isSatellite());
return(true);
}
return super.onKeyDown(keyCode, event);
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
댓글 : 1 개
- saza4mary
- 2011/05/12 PM 12:34
하앍 이클립스...기본적인건 배웠는데 폰없어서 GG..ㅜㅜ
user error : Error. B.