Exemplo n.º 1
0
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
    Location location = ((FlyWithMeActivity) getActivity()).getLocation();
    if (getArguments() != null) {
      if (cameraPosition == null)
        cameraPosition = getArguments().getParcelable(ARG_CAMERA_POSITION);
    }
    if (bundle != null) {
      if (cameraPosition == null) cameraPosition = bundle.getParcelable(ARG_CAMERA_POSITION);
    }

    View view = inflater.inflate(R.layout.takeoff_map, container, false);
    GoogleMapOptions mapOptions = new GoogleMapOptions();
    mapOptions.zoomControlsEnabled(false);
    if (cameraPosition != null) mapOptions.camera(cameraPosition);
    else if (location != null)
      mapOptions.camera(
          new CameraPosition(
              new LatLng(location.getLatitude(), location.getLongitude()), 10.0f, 0.0f, 0.0f));
    MapFragment mapFragment = MapFragment.newInstance(mapOptions);
    mapFragment.getMapAsync(this);
    FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
    transaction.replace(R.id.takeoffMapLayout, mapFragment).commit();
    return view;
  }
  public void preSetupMap() {
    GoogleMapOptions options = new GoogleMapOptions();
    options.zOrderOnTop(true);
    mapFragment = SupportMapFragment.newInstance(options);
    FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
    fragmentTransaction.replace(R.id.mapView, mapFragment);
    fragmentTransaction.commit();

    mapFragment.getMapAsync(
        new OnMapReadyCallback() {
          @Override
          public void onMapReady(GoogleMap googleMap) {
            MapFragment.this.map = googleMap;
            postSetupMap();
          }
        });
  }
 public static GoogleMapOptions b(CameraPosition paramCameraPosition)
 {
   GoogleMapOptions localGoogleMapOptions = new GoogleMapOptions();
   if (paramCameraPosition != null) {
     localGoogleMapOptions.a(paramCameraPosition);
   }
   localGoogleMapOptions.d(true);
   localGoogleMapOptions.h(true);
   localGoogleMapOptions.e(true);
   localGoogleMapOptions.g(true);
   localGoogleMapOptions.c(false);
   localGoogleMapOptions.f(true);
   localGoogleMapOptions.j(false);
   return localGoogleMapOptions;
 }
 public static GoogleMapOptions getReadOnlyOptions()
 {
   GoogleMapOptions localGoogleMapOptions = new GoogleMapOptions();
   localGoogleMapOptions.d(false);
   localGoogleMapOptions.h(false);
   localGoogleMapOptions.e(false);
   localGoogleMapOptions.g(false);
   localGoogleMapOptions.c(false);
   localGoogleMapOptions.f(false);
   localGoogleMapOptions.j(false);
   return localGoogleMapOptions;
 }