Google지도 v2에서 원이 그려지는 위치가 변경되면 바로 현재 위치로 표시됩니다. 이제 내가보고있는 것은 위치가 변경 될 때마다 원이 삭제되지 않고 계속 그려집니다 (위치가 동일하면 서로 겹쳐집니다). Marker에서도 똑같은 일이 발생합니다. 다음은 Google지도 v2에서 안드로이드로 원과 마커를 지우는 법
는@Override
public void onLocationChanged(Location location) {
if (location != null) {
// Create a LatLng object for the current location
LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
// Show the current location in Google Map
map.moveCamera(CameraUpdateFactory.newLatLng(latLng));
// Zoom in the Google Map
map.animateCamera(CameraUpdateFactory.zoomTo(14));
CircleOptions circleOptions = new CircleOptions().center(latLng) // set center
.radius(1000) // set radius in meters
.fillColor(Color.TRANSPARENT) // default
.strokeColor(0x10000000).strokeWidth(5);
myCircle = map.addCircle(circleOptions);
map.addMarker(new MarkerOptions().position(latLng).title("You are here!"));
}
V2 I는 구글지도에서 원을 그리는 데 사용하고있는 코드입니다 어떻게 내가 원이 다음 번에 그려지고 때마다 이전의 원과 마커에서 삭제되어 있는지 확인하십시오 Google지도. 코드에서 변경해야 할 사항은 무엇입니까?
도움이 될 것입니다.
감사 Rarw 제안합니다. 모든 예제를 통해이 사실을 더 잘 이해할 수 있습니다. – ferhan
조금씩 추가하겠습니다. – Rarw