마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

네비게이션 다시 건의 드리겠습니다.

+1 추천

// 상단에 내위치랑 거리 표현 

if(ismypoint){

ArrayList<LatLng> ar_lng=new ArrayList<LatLng>();
ar_lng.add(new LatLng(myla, myln));
ar_lng.add(buildlng);
PolylineOptions po=new PolylineOptions();
po.color(Color.RED);
po.width(5);
po.addAll(ar_lng);
mapFragment.getMap().addPolyline(po);
ar_lng.clear();
Log.e("거리", distance(myla, myln, buildla, buildln, 'k')+"");




if(distance(myla, myln, buildla, buildln, 'k')<10){
 if(!isalert){
  isalert=true;
  
  LayoutInflater gg=(LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
  View ac=gg.inflate(R.layout.layout_pop, null);
  ImageView img1=(ImageView) ac.findViewById(R.id.img1);
  TextView tx1=(TextView) ac.findViewById(R.id.alert_tx1);
  tx1.setText("걸린시간 : "+chm.getText());
  chm.stop();
  img1.setImageResource(R.drawable.a11+imgnum);
  //layout_pop에 이미지 붙이기
  new AlertDialog.Builder(MainActivity.this).setTitle("도착 : "+arr_build[imgnum]).setPositiveButton("닫기", new DialogInterface.OnClickListener() {
   
   @Override
   public void onClick(DialogInterface arg0, int arg1) {
    // TODO Auto-generated method stub
    arg0.dismiss();
    isalert=false;
   }
  }).setView(ac).show();
  //알림창
 }

}
}
//처음에 카메라 무브 1번하기 위해서



if(!ismypoint){
 mapFragment.getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(mylatlng, 15f));
 //카메라 무브 한번 한다.
 
}

//작업 내위치 한번 찍어준다.

}

/**
* Callback called when connected to GCore. Implementation of {@link ConnectionCallbacks}.
*/
@Override
public void onConnected(Bundle connectionHint) {
LocationServices.FusedLocationApi.requestLocationUpdates(
        mGoogleApiClient,
        REQUEST,
        this);  // LocationListener

}

/**
* Callback called when disconnected from GCore. Implementation of {@link ConnectionCallbacks}.
*/
@Override
public void onConnectionSuspended(int cause) {
// Do nothing
}

/**
* Implementation of {@link OnConnectionFailedListener}.
*/
@Override
public void onConnectionFailed(ConnectionResult result) {
// Do nothing
}

@Override
public boolean onMyLocationButtonClick() {
Toast.makeText(this, "MyLocation button clicked", Toast.LENGTH_SHORT).show();
// Return false so that we don't consume the event and the default behavior still occurs
// (the camera animates to the user's current position).
return false;
}

@Override
public void onProviderDisabled(String provider) {
 // TODO Auto-generated method stub
 
}

@Override
public void onProviderEnabled(String provider) {
 // TODO Auto-generated method stub
 
}

@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
 // TODO Auto-generated method stub
 
}

@Override
 protected void onActivityResult(int arg0, int arg1, Intent arg2) {
  // TODO Auto-generated method stub
  super.onActivityResult(arg0, arg1, arg2);
  
  //내 목적지를 누르고 선택한 부분을 받아오는부분
  if(arg0==1){
   int  g=arg2.getIntExtra("num", 0);
   imgnum=g;
   map.clear();
     LatLng ll= getbuilwhere(g);
     buildla=ll.latitude;
     buildln=ll.longitude;
     ismypoint=true;

저희가 네비게이션을 만들어 보고 있습니다.

저희가 apk로 실행을 해본결과 정상적으로 작동은 됩니다.

다만 문제가 현위치에서 목적지까지 빨간줄이 표시가 되는데

이것을 길따라서 빨간줄 표시가 가능할가여??

 

http://blog.naver.com/ghkdii 여기로 들어가시면 이미지가 있습니다.

스타일이야 (170 포인트) 님이 2015년 5월 7일 질문

1개의 답변

0 추천
길찾기 API 를 검색 해보시면 될것 같네요.

 

다음지도에서는 제공해주는거 같습니다만.
갈무리 (12,430 포인트) 님이 2015년 5월 7일 답변
구글로는 제공이 안되나여??
맵을 안쓴지 오래 돼서 잘 모르지만 한국은 안되는걸로 알고 있어요
...