小编Man*_*iga的帖子

使用ViewPager的SupportMapFragment:无法移动相机或更改地图设置

我有一个问题,SupportMapFragment并将相机移动到地图上的某个位置.

public class MapPositionFragment extends SupportMapFragment implements LocationListener{

private GoogleMap map = null;
private Button lockButton = null;
private Location currentLocation = null;
private LocationManager locationManager = null;
private View mapView = null;

@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    mapView = super.onCreateView(inflater, container, savedInstanceState);
    View v = inflater.inflate(R.layout.fragment_route_map, container, false);

    SetUpMap(v);
    return v;
  }

@Override
public void onResume() {
    // TODO Auto-generated method stub
    super.onResume();
}

@Override
public void setUserVisibleHint(boolean isVisibleToUser) {

    if (isVisibleToUser){ …
Run Code Online (Sandbox Code Playgroud)

android map android-viewpager google-maps-android-api-2 supportmapfragment

4
推荐指数
1
解决办法
2486
查看次数