onCurrentLocationUpdate 호출

안녕하세요. 안드로이드로 다음지도 API를 구현하고 있는데요.

현재 위치를 지도상에 표시하기 위해 MapView.CurrentLocationEventListener등록과 관련된 함수(onCurrentLocationUpdate 등)을 삽입했는데… 위치가 표시되지 않네요. GPS와 관련된 부분을 기술해야하나요? 아니면 MapView.CurrentLocationEventListener를 통해 GPS부분을 기술안해도 위치정보를 받을 수 있나요?

1개의 좋아요

mMapView = (MapView) findViewById(R.id.map_view);
mMapView.setDaumMapApiKey(API_KEY);
mMapView.setCurrentLocationTrackingMode(MapView.CurrentLocationTrackingMode.TrackingModeOnWithoutHeading);
mMapView.setCurrentLocationEventListener(mCurrentLocationEventListener);

CurrentLocationEventListener만 설정하시면 안되고 TrackingMode를 설정해주셔야 합니다.
트랙킹모드 설정하시면 onCurrentLocationUpdate()부분이 실행 되실거에요

1개의 좋아요