조각에 MapView를 표시하려고합니다. 지도는 내가 예상 한대로 표시되지만 사진으로 만 표시됩니다. 드래그하여 카메라를 움직이거나 확대/축소하여 확대/축소 할 수 없습니다. SupportMapFragment를 사용하려고했지만 동일한 결과가 나타납니다.안드로이드 MapView 초기화 후 조각 고정 (클릭 할 수 없거나 드래그 할 수 없음)
내 활동에 NavigationView가 있습니다. NavigationView 및 MapView의 터치 이벤트에 충돌이 있다고 생각하지 않습니다.
누구나 전에 만났습니까?
조각
public class CustomizedMapFragment extends Fragment implements OnMapReadyCallback{
MapView mapView;
GoogleMap googleMap;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_map, container, false);
mapView = (MapView) rootView.findViewById(R.id.mapView);
mapView.onCreate(savedInstanceState);
mapView.getMapAsync(this);
return rootView;
}
@Override
public void onMapReady(GoogleMap googleMap) {
this.googleMap = googleMap;
this.googleMap.getUiSettings().setZoomControlsEnabled(true);
this.googleMap.getUiSettings().setZoomGesturesEnabled(true);
}
@Override
public void onResume() {
super.onResume();
mapView.onResume();
}
@Override
public void onPause() {
super.onPause();
mapView.onPause();
}
@Override
public void onDestroy() {
super.onDestroy();
mapView.onDestroy();
}
@Override
public void onLowMemory() {
super.onLowMemory();
mapView.onLowMemory();
}
}
레이아웃이 UiSettings.setScrollGesturesEnabled(boolean)
를 사용하는
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<com.google.android.gms.maps.MapView
android:layout_margin="16dp"
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
대답을 살펴보면 도움이 될 것입니다. http://stackoverflow.com/questions/5758081/mapview-works-incorrect –
@DanielNugent @ clickable을 true로 설정하려고했지만 작동하지 않습니다. – DemonPilot
Did 당신은'OnMapClickListener'을 구현합니까? –