content: package Guzzlecode.IntentCaller.fragment;
  
  import android.os.Bundle;
  
  import androidx.fragment.app.Fragment;
  
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  import com.google.android.gms.maps.CameraUpdateFactory;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.OnMapReadyCallback;
  import com.google.android.gms.maps.SupportMapFragment;
  import com.google.android.gms.maps.model.LatLng;
  import com.google.android.gms.maps.model.MarkerOptions;
  
  import Guzzlecode.IntentCaller.R;
  
  
  public class MapsFragment extends Fragment {
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          View view = inflater.inflate(R.layout.fragment_maps, container, false);
  
          SupportMapFragment supportMapFragment = (SupportMapFragment)getChildFragmentManager().findFragmentById(R.id.google_maps);
          supportMapFragment.getMapAsync(new OnMapReadyCallback() {
              @Override
              public void onMapReady(GoogleMap googleMap) {
                  googleMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
                      @Override
                      public void onMapClick(LatLng latLng) {
                          MarkerOptions markerOptions = new MarkerOptions();
                          markerOptions.position(latLng);
                          markerOptions.title(latLng.latitude + " : " + latLng.longitude);
                          googleMap.clear();
                          googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(
                                  latLng, 10
                          ));
                          googleMap.addMarker(markerOptions);
                      }
                  });
              }
          });
  
          return view;
      }
  }