▶◀

▲예전에 처음 받아본 조공
유키카제 파네토네
접속 : 5477   Lv. 143

Category

Profile

Counter

  • 오늘 : 519 명
  • 전체 : 1344193 명
  • Mypi Ver. 0.3.1 β
[(?)헛소리] 안드로이드 (1) 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;
}

}

신고

 

saza4mary    친구신청

하앍 이클립스...기본적인건 배웠는데 폰없어서 GG..ㅜㅜ
X