글쎄, 당신은 현재의 위도와 경도 gps를 사용하여 같아요. 그 후에는 정말 간단합니다. 마커 객체를 만들고이를지도에 추가합니다.
MarkerOptions yourMakerOptions;
Marker yourMarker;
yourMakerOptions = new MarkerOptions();
yourMakerOptions.title("Title");
yourMakerOptions.snippet("");
yourMarkerOptions.position(new LatLng(currentLatitude,currentLongitude));
//Set your marker icon using this method.
yourMakerOptions.icon();
마지막으로지도에 추가하십시오.
yourMarker = map.addMarker(yourMakerOptions);
지도를 현재 위치로 이동하려면 버튼의 onClickListener에서이 메소드를 호출하십시오.
map.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(currentLatitude, currentLongitude), 14));
희망이 도움이됩니다.
이 시도 :
map.setMyLocationEnabled(true);
map.getUiSettings().setMyLocationButtonEnabled(false);
당신이 파일 AndroidManifest를에 권한을 추가 했습니까? –
예 .. 추가되었습니다! –