// Path: OpenTreeMap/src/main/java/org/azavea/helpers/GoogleMapsListeners.java
// public class GoogleMapsListeners {
//     // We need to set a listener for marker drag, or markers will not give the correct position
//     // when we later call marker.getPosition()
//     // Note that we do not have to actually *do* anything in our listener
//     public static class NoopDragListener implements GoogleMap.OnMarkerDragListener {
// 
//         @Override
//         public void onMarkerDragStart(Marker marker) {
// 
//         }
// 
//         @Override
//         public void onMarkerDrag(Marker marker) {
// 
//         }
// 
//         @Override
//         public void onMarkerDragEnd(Marker marker) {
// 
//         }
//     }
// }


import android.app.Activity;
import android.app.FragmentManager;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.UiSettings;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import org.azavea.helpers.GoogleMapsListeners;
import org.azavea.helpers.Logger;
import org.azavea.otm.R;
import org.azavea.otm.data.Geometry;
import org.azavea.otm.data.Plot;
import org.json.JSONException;
import org.json.JSONObject;
                if (map != null) {
                    mMap = map;
                    setUpMap();
                } else {
                    Log.e("VIN", "map was null.");
                }
            });
        }
    }

    protected void onMapLoad(OnMapReadyCallback cb) {
        if (mMap != null) {
            cb.onMapReady(mMap);
        }
        // Try to obtain the map from the MapFragment.
        // we have to try for 2 different fragment id's, using the reasonable
        // assumption that the base classes are going to be instantiated one
        // at a time.
        FragmentManager fragmentManager = getFragmentManager();
        MapFragment fragment = (MapFragment) fragmentManager.findFragmentById(mapFragmentId);
        fragment.getMapAsync(cb);
    }

    private void setUpMap() {
        UiSettings mUiSettings = mMap.getUiSettings();
        mUiSettings.setZoomControlsEnabled(false);
        mUiSettings.setScrollGesturesEnabled(false);
        mUiSettings.setZoomGesturesEnabled(false);
        mUiSettings.setTiltGesturesEnabled(false);
        mUiSettings.setRotateGesturesEnabled(false);
// Path: OpenTreeMap/src/main/java/org/azavea/helpers/GoogleMapsListeners.java
// public class GoogleMapsListeners {
//     // We need to set a listener for marker drag, or markers will not give the correct position
//     // when we later call marker.getPosition()
//     // Note that we do not have to actually *do* anything in our listener
//     public static class NoopDragListener implements GoogleMap.OnMarkerDragListener {
// 
//         @Override
//         public void onMarkerDragStart(Marker marker) {
// 
//         }
// 
//         @Override
//         public void onMarkerDrag(Marker marker) {
// 
//         }
// 
//         @Override
//         public void onMarkerDragEnd(Marker marker) {
// 
//         }
//     }
// }


// Path: OpenTreeMap/src/main/java/org/azavea/otm/ui/TreeDisplay.java
import android.app.Activity;
import android.app.FragmentManager;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.UiSettings;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import org.azavea.helpers.GoogleMapsListeners;
import org.azavea.helpers.Logger;
import org.azavea.otm.R;
import org.azavea.otm.data.Geometry;
import org.azavea.otm.data.Plot;
import org.json.JSONException;
import org.json.JSONObject;

                if (map != null) {
                    mMap = map;
                    setUpMap();
                } else {
                    Log.e("VIN", "map was null.");
                }
            });
        }
    }

    protected void onMapLoad(OnMapReadyCallback cb) {
        if (mMap != null) {
            cb.onMapReady(mMap);
        }
        // Try to obtain the map from the MapFragment.
        // we have to try for 2 different fragment id's, using the reasonable
        // assumption that the base classes are going to be instantiated one
        // at a time.
        FragmentManager fragmentManager = getFragmentManager();
        MapFragment fragment = (MapFragment) fragmentManager.findFragmentById(mapFragmentId);
        fragment.getMapAsync(cb);
    }

    private void setUpMap() {
        UiSettings mUiSettings = mMap.getUiSettings();
        mUiSettings.setZoomControlsEnabled(false);
        mUiSettings.setScrollGesturesEnabled(false);
        mUiSettings.setZoomGesturesEnabled(false);
        mUiSettings.setTiltGesturesEnabled(false);
        mUiSettings.setRotateGesturesEnabled(false);
        mMap.setOnMarkerDragListener(new GoogleMapsListeners.NoopDragListener());