Finished converting FMC over to the new SkyHookUserOverlayMapFragment
Change-Id: I9059afeec89b5e5fea735c3800b7465bb9ff6e72 Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
@@ -12,23 +12,18 @@
|
|||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
layout="@layout/distancebar" />
|
layout="@layout/distancebar" />
|
||||||
|
|
||||||
<!-- ricky beta release 0rKmsWMM0D-IRAEgcSZEqwZCs_8AUwxjYjj0bnA -->
|
<fragment
|
||||||
<!-- ricky 0rKmsWMM0D-KC9KXr1WbA5aEb-2ozQ0SHTvV46g -->
|
android:id="@+id/map_fragment"
|
||||||
<!-- TWENTYCODES 0rKmsWMM0D-K15bEM_kwabPbNhsn4dp4rcq2q5Q -->
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
class="com.TwentyCodes.android.SkyHook.SkyHoookUserOverlayMapFragment" >
|
||||||
|
|
||||||
<com.TwentyCodes.android.location.MapView
|
<!-- Preview: layout=@layout/map_fragment -->
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
</fragment>
|
||||||
android:id="@+id/mapview"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:layout_above="@+id/buttons"
|
|
||||||
android:layout_below="@id/table"
|
|
||||||
android:apiKey="0rKmsWMM0D-K15bEM_kwabPbNhsn4dp4rcq2q5Q"
|
|
||||||
android:clickable="true" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@id/mapview"
|
android:id="@id/map_fragment"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:layout_below="@id/table" />
|
android:layout_below="@id/table" />
|
||||||
@@ -47,7 +42,7 @@
|
|||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@id/buttons"
|
android:id="@+id/buttons"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
|
|||||||
@@ -128,9 +128,9 @@ public class Main extends FragmentActivity implements RegistrationCallback, MapF
|
|||||||
*/
|
*/
|
||||||
if(!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER))
|
if(!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER))
|
||||||
enableGPSdialog(Main.this);
|
enableGPSdialog(Main.this);
|
||||||
else
|
// else
|
||||||
if(mMap != null)
|
// if(mMap != null)
|
||||||
mMap.setGPSDialogEnabled(true);
|
// mMap.setGPSDialogEnabled(true);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* the map is no longer needed, clear it from memory
|
* the map is no longer needed, clear it from memory
|
||||||
@@ -448,7 +448,7 @@ public class Main extends FragmentActivity implements RegistrationCallback, MapF
|
|||||||
* Shows the splash screen over the full Activity
|
* Shows the splash screen over the full Activity
|
||||||
*/
|
*/
|
||||||
protected void showSplashScreen() {
|
protected void showSplashScreen() {
|
||||||
mMap.setGPSDialogEnabled(false);
|
// mMap.setGPSDialogEnabled(false);
|
||||||
mSplashDialog = new Dialog(this, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
|
mSplashDialog = new Dialog(this, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
|
||||||
mSplashDialog.setContentView(R.layout.powered_by_skyhook);
|
mSplashDialog.setContentView(R.layout.powered_by_skyhook);
|
||||||
mSplashDialog.setCancelable(false);
|
mSplashDialog.setCancelable(false);
|
||||||
@@ -498,9 +498,10 @@ public class Main extends FragmentActivity implements RegistrationCallback, MapF
|
|||||||
*/
|
*/
|
||||||
if(mSettings.getInt(Settings.BUILD_NUMBER, 0) < build_number || Debug.FORCE_FIRSTBOOT_DIALOG){
|
if(mSettings.getInt(Settings.BUILD_NUMBER, 0) < build_number || Debug.FORCE_FIRSTBOOT_DIALOG){
|
||||||
displayWelcomeDialog();
|
displayWelcomeDialog();
|
||||||
} else {
|
|
||||||
mMap.setGPSDialogEnabled(true);
|
|
||||||
}
|
}
|
||||||
|
// else {
|
||||||
|
// mMap.setGPSDialogEnabled(true);
|
||||||
|
// }
|
||||||
|
|
||||||
mSettings.edit().putInt(Settings.BUILD_NUMBER, build_number).commit();
|
mSettings.edit().putInt(Settings.BUILD_NUMBER, build_number).commit();
|
||||||
} catch (NameNotFoundException e) {
|
} catch (NameNotFoundException e) {
|
||||||
|
|||||||
@@ -18,14 +18,12 @@ import android.content.Context;
|
|||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.res.Resources;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.os.Vibrator;
|
import android.os.Vibrator;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.TypedValue;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
@@ -43,7 +41,7 @@ import com.TwentyCodes.android.FindMyCarLib.Settings;
|
|||||||
import com.TwentyCodes.android.FindMyCarLib.UI.DirectionsOverlay;
|
import com.TwentyCodes.android.FindMyCarLib.UI.DirectionsOverlay;
|
||||||
import com.TwentyCodes.android.FindMyCarLib.UI.DirectionsOverlay.OnDirectionsCompleteListener;
|
import com.TwentyCodes.android.FindMyCarLib.UI.DirectionsOverlay.OnDirectionsCompleteListener;
|
||||||
import com.TwentyCodes.android.FindMyCarLib.UI.FindMyCarOverlay;
|
import com.TwentyCodes.android.FindMyCarLib.UI.FindMyCarOverlay;
|
||||||
import com.TwentyCodes.android.SkyHook.SkyHookUserOverlay;
|
import com.TwentyCodes.android.SkyHook.SkyHoookUserOverlayMapFragment;
|
||||||
import com.TwentyCodes.android.location.GeoPointLocationListener;
|
import com.TwentyCodes.android.location.GeoPointLocationListener;
|
||||||
import com.TwentyCodes.android.location.GeoUtils;
|
import com.TwentyCodes.android.location.GeoUtils;
|
||||||
import com.TwentyCodes.android.location.MapView;
|
import com.TwentyCodes.android.location.MapView;
|
||||||
@@ -52,6 +50,7 @@ import com.google.android.maps.GeoPoint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* this is the main class FindMyCar Full
|
* this is the main class FindMyCar Full
|
||||||
|
*
|
||||||
* @author WWPowers
|
* @author WWPowers
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
@@ -71,23 +70,25 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
public static TextView mDistance;
|
public static TextView mDistance;
|
||||||
public static boolean isMetric = true;
|
public static boolean isMetric = true;
|
||||||
public static TextView mAccuracy;
|
public static TextView mAccuracy;
|
||||||
public static SkyHookUserOverlay mUserOverlay;
|
|
||||||
public static MapView mMapView;
|
|
||||||
private SharedPreferences mSettings;
|
private SharedPreferences mSettings;
|
||||||
private Handler mHandler;
|
private Handler mHandler;
|
||||||
private ProgressDialog mProgress;
|
private ProgressDialog mProgress;
|
||||||
private boolean isGPSDialogEnabled = true;
|
|
||||||
protected DirectionsOverlay mDirections;
|
protected DirectionsOverlay mDirections;
|
||||||
private MapFragmentListener mListener;
|
private MapFragmentListener mListener;
|
||||||
|
private SkyHoookUserOverlayMapFragment mMap;
|
||||||
|
|
||||||
public interface MapFragmentListener {
|
public interface MapFragmentListener {
|
||||||
public void onCarDeleted();
|
public void onCarDeleted();
|
||||||
|
|
||||||
public void onDirectionsDisplayed(DirectionsOverlay directions);
|
public void onDirectionsDisplayed(DirectionsOverlay directions);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns a string distance that is based on the users measurement unit preference
|
* returns a string distance that is based on the users measurement unit
|
||||||
* @param distance in kilometers
|
* preference
|
||||||
|
*
|
||||||
|
* @param distance
|
||||||
|
* in kilometers
|
||||||
* @return string distance
|
* @return string distance
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
@@ -97,9 +98,9 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* if blnUnit is true, the distance computed will be in metric units,
|
* if blnUnit is true, the distance computed will be in metric units,
|
||||||
* else, standard units are used
|
* else, standard units are used meters are used until 1 kilometer is
|
||||||
* meters are used until 1 kilometer is reached, then kilometers are used
|
* reached, then kilometers are used feet are used until 1 mile is
|
||||||
* feet are used until 1 mile is reached, then miles are used
|
* reached, then miles are used
|
||||||
*/
|
*/
|
||||||
if (isMetric) {
|
if (isMetric) {
|
||||||
if (distance < 1) {
|
if (distance < 1) {
|
||||||
@@ -117,23 +118,26 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pans maps to where the a geopoint is, and if zoomIn is true, zooms in to level 20
|
* pans maps to where the a geopoint is, and if zoomIn is true, zooms in to
|
||||||
* @param GeoPoint point - lat and lon of point to pan to
|
* level 20
|
||||||
|
*
|
||||||
|
* @param GeoPoint
|
||||||
|
* point - lat and lon of point to pan to
|
||||||
* @param boolean zoomIn - true if map needs to be zoomed in
|
* @param boolean zoomIn - true if map needs to be zoomed in
|
||||||
* @return boolean false it geopoint is null
|
* @return boolean false it geopoint is null
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
public boolean panToGeoPoint(GeoPoint point, boolean zoomIn) {
|
public boolean panToGeoPoint(GeoPoint point, boolean zoomIn) {
|
||||||
if (point != null) {
|
if (point != null) {
|
||||||
if (mMapView != null) {
|
if (mMap != null) {
|
||||||
try {
|
try {
|
||||||
mMapView.getController().stopAnimation(false);
|
mMap.getMap().getController().setCenter(point);
|
||||||
mMapView.getController().setCenter(point);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (zoomIn) {
|
if (zoomIn) {
|
||||||
mMapView.getController().setZoom((mMapView.getMaxZoomLevel() - 2));
|
mMap.getMap().getController()
|
||||||
|
.setZoom((mMap.getMap().getMaxZoomLevel() - 2));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.e(TAG, "panToGeoPoint call. mapcontroller was null");
|
Log.e(TAG, "panToGeoPoint call. mapcontroller was null");
|
||||||
@@ -147,6 +151,7 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* removes the car overlay from the mapview.
|
* removes the car overlay from the mapview.
|
||||||
|
*
|
||||||
* @return true if successful
|
* @return true if successful
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
@@ -163,7 +168,7 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mMapView.getOverlays().remove(mCarOverlay);
|
mMap.getMap().getOverlays().remove(mCarOverlay);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -171,11 +176,12 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
}
|
}
|
||||||
|
|
||||||
public MapView getMap() {
|
public MapView getMap() {
|
||||||
return mMapView;
|
return mMap.getMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* loads saved settings from files
|
* loads saved settings from files
|
||||||
|
*
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
private void loadSettings() {
|
private void loadSettings() {
|
||||||
@@ -201,24 +207,20 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
|
|
||||||
// load compass options
|
// load compass options
|
||||||
String compass_option = mSettings.getString(Settings.COMPASS_OPTION, "Small");
|
String compass_option = mSettings.getString(Settings.COMPASS_OPTION, "Small");
|
||||||
int px;
|
|
||||||
Resources r = getResources();
|
|
||||||
if (compass_option.equalsIgnoreCase("Large")) {
|
if (compass_option.equalsIgnoreCase("Large")) {
|
||||||
px = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 110, r.getDisplayMetrics());
|
mMap.setCompassDrawables(R.drawable.needle_lrg, R.drawable.compass_lrg, 110, 110);
|
||||||
mUserOverlay.setCompassDrawables(R.drawable.needle_lrg, R.drawable.compass_lrg, px, px);
|
|
||||||
} else if (compass_option.equalsIgnoreCase("Small")) {
|
} else if (compass_option.equalsIgnoreCase("Small")) {
|
||||||
px = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 40, r.getDisplayMetrics());
|
mMap.setCompassDrawables(R.drawable.needle_sm, R.drawable.compass_sm, 40, 40);
|
||||||
mUserOverlay.setCompassDrawables(R.drawable.needle_sm, R.drawable.compass_sm, px, px);
|
|
||||||
} else {
|
} else {
|
||||||
px = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 70, r.getDisplayMetrics());
|
mMap.setCompassDrawables(R.drawable.needle_med, R.drawable.compass_med, 70, 70);
|
||||||
mUserOverlay.setCompassDrawables(R.drawable.needle_med, R.drawable.compass_med, px, px);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* using the users lat/lon saves car location to lat/lon files and passes that geopoint info to setCar
|
* using the users lat/lon saves car location to lat/lon files and passes
|
||||||
* also writes address to notes
|
* that geopoint info to setCar also writes address to notes
|
||||||
|
*
|
||||||
* @author ricky barrette 3-31-2010
|
* @author ricky barrette 3-31-2010
|
||||||
* @author WWPowers 3-31-2010
|
* @author WWPowers 3-31-2010
|
||||||
*/
|
*/
|
||||||
@@ -226,78 +228,87 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
// removed old parking timer
|
// removed old parking timer
|
||||||
// ParkingTimerDialog.stopTimer(this);
|
// ParkingTimerDialog.stopTimer(this);
|
||||||
|
|
||||||
GeoPoint user = mUserOverlay.getUserLocation();
|
GeoPoint user = mMap.getUserLocation();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if the user location is not null then
|
* if the user location is not null then save car lat and lon to files
|
||||||
* save car lat and lon to files
|
* pass geopoint info to set car, which will setup and show the car
|
||||||
* pass geopoint info to set car, which will setup and show the car overlay
|
* overlay get address info and add it to the notes file
|
||||||
* get address info and add it to the notes file
|
|
||||||
*
|
*
|
||||||
* else inform user that they dont have a gps signal
|
* else inform user that they dont have a gps signal
|
||||||
*/
|
*/
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
mSettings.edit()
|
mSettings.edit().putInt(Settings.LAT, user.getLatitudeE6())
|
||||||
.putInt(Settings.LAT, user.getLatitudeE6())
|
.putInt(Settings.LON, user.getLongitudeE6()).commit();
|
||||||
.putInt(Settings.LON, user.getLongitudeE6())
|
|
||||||
.commit();
|
|
||||||
|
|
||||||
setCar(user);
|
setCar(user);
|
||||||
|
|
||||||
// TODO get address
|
// TODO get address
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), R.string.no_gps_signal, Toast.LENGTH_LONG).show();
|
Toast.makeText(getActivity(), R.string.no_gps_signal,
|
||||||
|
Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ask user if they want to replace current car marker with a new one
|
* ask user if they want to replace current car marker with a new one
|
||||||
|
*
|
||||||
* @since 0.1.1
|
* @since 0.1.1
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
public void markCarDialog() {
|
public void markCarDialog() {
|
||||||
new AlertDialog.Builder(getActivity())
|
new AlertDialog.Builder(getActivity())
|
||||||
.setMessage(R.string.mark_car_warning).setCancelable(false)
|
.setMessage(R.string.mark_car_warning)
|
||||||
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(R.string.yes,
|
||||||
|
new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
removeCar();
|
removeCar();
|
||||||
markCar();
|
markCar();
|
||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
|
.setNegativeButton(R.string.no,
|
||||||
|
new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
}
|
}
|
||||||
})
|
}).show();
|
||||||
.show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see android.support.v4.app.Fragment#onCreateOptionsMenu(android.view.Menu, android.view.MenuInflater)
|
*
|
||||||
|
* @see android.support.v4.app.Fragment#onCreateOptionsMenu(android.view.Menu,
|
||||||
|
* android.view.MenuInflater)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||||
inflater.inflate(R.menu.map_action_bar, menu);
|
inflater.inflate(R.menu.map_action_bar, menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see com.google.android.maps.MapActivity#onCreate(android.os.Bundle)
|
* @see com.google.android.maps.MapActivity#onCreate(android.os.Bundle)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
container.removeAllViews();
|
container.removeAllViews();
|
||||||
|
|
||||||
View view = inflater.inflate(R.layout.map, container, false);
|
View view = inflater.inflate(R.layout.map, container, false);
|
||||||
|
|
||||||
mMapView = (MapView) view.findViewById(R.id.mapview);
|
mMap = (SkyHoookUserOverlayMapFragment) getFragmentManager()
|
||||||
|
.findFragmentById(R.id.map_fragment);
|
||||||
setUiHandler();
|
setUiHandler();
|
||||||
|
|
||||||
mAccuracy = (TextView) view.findViewById(R.id.tvAccuracy2);
|
mAccuracy = (TextView) view.findViewById(R.id.tvAccuracy2);
|
||||||
mDistance = (TextView) view.findViewById(R.id.tvDistance2);
|
mDistance = (TextView) view.findViewById(R.id.tvDistance2);
|
||||||
mSettings = getActivity().getSharedPreferences(Settings.SETTINGS, Context.MODE_WORLD_WRITEABLE);
|
mSettings = getActivity().getSharedPreferences(Settings.SETTINGS,
|
||||||
|
Context.MODE_WORLD_WRITEABLE);
|
||||||
|
|
||||||
view.findViewById(R.id.my_location).setOnClickListener(this);
|
view.findViewById(R.id.my_location).setOnClickListener(this);
|
||||||
view.findViewById(R.id.mark_my_location).setOnClickListener(this);
|
view.findViewById(R.id.mark_my_location).setOnClickListener(this);
|
||||||
@@ -316,10 +327,13 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
if (mListener != null)
|
if (mListener != null)
|
||||||
mListener.onDirectionsDisplayed(directionsOverlay);
|
mListener.onDirectionsDisplayed(directionsOverlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* here we will overrride onLocationChanged() so we can update the FindMyCarUI
|
* here we will overrride onLocationChanged() so we can update the
|
||||||
* (non-Javadoc)
|
* FindMyCarUI (non-Javadoc)
|
||||||
* @see com.TwentyCodes.android.SkyHook.map.SkyHookUserOverlay#onLocationChanged(com.google.android.maps.GeoPoint, int)
|
*
|
||||||
|
* @see com.TwentyCodes.android.SkyHook.map.SkyHookUserOverlay#onLocationChanged(com.google.android.maps.GeoPoint,
|
||||||
|
* int)
|
||||||
* @param point
|
* @param point
|
||||||
* @param accuracy
|
* @param accuracy
|
||||||
* @author Ricky Barrette
|
* @author Ricky Barrette
|
||||||
@@ -332,23 +346,30 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
mHandler.sendMessage(mHandler.obtainMessage(ACCURACY, distance(accuracy/1E3)));
|
mHandler.sendMessage(mHandler.obtainMessage(ACCURACY,
|
||||||
|
distance(accuracy / 1E3)));
|
||||||
|
|
||||||
// if (point != null)
|
// if (point != null)
|
||||||
// if(isShowingBoth)
|
// if(isShowingBoth)
|
||||||
// if(GeoUtils.isPointOffMap(mMapView,point) || GeoUtils.isPointOffMap(mMapView, mCarPoint))
|
// if(GeoUtils.isPointOffMap(mMap.getMap(),point) ||
|
||||||
|
// GeoUtils.isPointOffMap(mMap.getMap(), mCarPoint))
|
||||||
// mHandler.sendEmptyMessage(SHOWBOTH);
|
// mHandler.sendEmptyMessage(SHOWBOTH);
|
||||||
//
|
//
|
||||||
if (mCarPoint != null && point != null) {
|
if (mCarPoint != null && point != null) {
|
||||||
double distance = GeoUtils.distanceKm(point, mCarPoint);
|
double distance = GeoUtils.distanceKm(point, mCarPoint);
|
||||||
mHandler.sendMessage(mHandler.obtainMessage(DISTANCE, distance(distance)));
|
mHandler.sendMessage(mHandler.obtainMessage(DISTANCE,
|
||||||
|
distance(distance)));
|
||||||
|
|
||||||
//value is set in KM. if user has gone 30 feet from car app is set to check for arrival
|
// value is set in KM. if user has gone 30 feet from car app
|
||||||
|
// is set to check for arrival
|
||||||
if (distance > 0.009144) {
|
if (distance > 0.009144) {
|
||||||
hasLeftCar = true;
|
hasLeftCar = true;
|
||||||
}
|
}
|
||||||
//if user has gone back into 30 foot radius and has not found the car and has left the car then notify user of finding of car
|
// if user has gone back into 30 foot radius and has not
|
||||||
if (distance <= 0.009144 && isCarFound == false && hasLeftCar == true){
|
// found the car and has left the car then notify user of
|
||||||
|
// finding of car
|
||||||
|
if (distance <= 0.009144 && isCarFound == false
|
||||||
|
&& hasLeftCar == true) {
|
||||||
isCarFound = true;
|
isCarFound = true;
|
||||||
|
|
||||||
mHandler.sendEmptyMessage(FOUND_CAR);
|
mHandler.sendEmptyMessage(FOUND_CAR);
|
||||||
@@ -361,6 +382,7 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* handles menu selection
|
* handles menu selection
|
||||||
|
*
|
||||||
* @since 0.0.2
|
* @since 0.0.2
|
||||||
* @author ricky barrette 3-30-2010
|
* @author ricky barrette 3-30-2010
|
||||||
*/
|
*/
|
||||||
@@ -377,62 +399,23 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see android.support.v4.app.Fragment#onPause()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onPause() {
|
|
||||||
mUserOverlay.disableCompass();
|
|
||||||
mUserOverlay.disableMyLocation();
|
|
||||||
mMapView.getOverlays().remove(mUserOverlay);
|
|
||||||
mUserOverlay = null;
|
|
||||||
super.onPause();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called each time the menu is created starting with the second instance.
|
|
||||||
* Used to dynamicly modify the options menu
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see android.support.v4.app.Fragment#onResume()
|
* @see android.support.v4.app.Fragment#onResume()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
if(mUserOverlay == null)
|
|
||||||
mUserOverlay = new SkyHookUserOverlay(mMapView, getActivity());
|
|
||||||
|
|
||||||
mMapView.getOverlays().add(mUserOverlay);
|
|
||||||
|
|
||||||
//start all location based services
|
|
||||||
mUserOverlay.enableMyLocation();
|
|
||||||
if(!isGPSDialogEnabled)
|
|
||||||
mUserOverlay.disableGPSDialog();
|
|
||||||
|
|
||||||
mUserOverlay.registerListener(this);
|
|
||||||
mUserOverlay.enableCompass();
|
|
||||||
|
|
||||||
loadSettings();
|
loadSettings();
|
||||||
super.onResume();
|
super.onResume();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* reorders the overlays to the UserOverlay always on top
|
* removes the previous car overlay and replaces it with a new car overlay
|
||||||
* @author ricky barrette
|
* that represents the users car at a specific geopoint
|
||||||
*/
|
|
||||||
private void reorderOverlays() {
|
|
||||||
mMapView.getOverlays().remove(mUserOverlay);
|
|
||||||
mMapView.getOverlays().add(mUserOverlay);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* removes the previous car overlay and replaces it with a new car overlay that
|
|
||||||
* represents the users car at a specific geopoint
|
|
||||||
*
|
*
|
||||||
* @param point for geopoint of car
|
* @param point
|
||||||
|
* for geopoint of car
|
||||||
* @author WWPowers 3-31-2010
|
* @author WWPowers 3-31-2010
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
@@ -441,28 +424,27 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
hasLeftCar = false;
|
hasLeftCar = false;
|
||||||
mCarPoint = point;
|
mCarPoint = point;
|
||||||
mCarOverlay = new FindMyCarOverlay(getActivity(), point);
|
mCarOverlay = new FindMyCarOverlay(getActivity(), point);
|
||||||
mMapView.getOverlays().add(mCarOverlay);
|
mMap.getMap().getOverlays().add(mCarOverlay);
|
||||||
mUserOverlay.setDestination(mCarPoint);
|
mMap.setDestination(mCarPoint);
|
||||||
reorderOverlays();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* enables the GPS dialog
|
// * enables the GPS dialog
|
||||||
* @param b
|
// *
|
||||||
* @author ricky barrette
|
// * @param b
|
||||||
*/
|
// * @author ricky barrette
|
||||||
public void setGPSDialogEnabled(boolean b) {
|
// */
|
||||||
isGPSDialogEnabled = b;
|
// public void setGPSDialogEnabled(boolean b) {
|
||||||
if(mUserOverlay != null)
|
// if (mMap != null)
|
||||||
if(b)
|
// if (b)
|
||||||
mUserOverlay.enableGPSDialog();
|
// mMap.enableGPSDialog();
|
||||||
else
|
// else
|
||||||
mUserOverlay.disableGPSDialog();
|
// mMap.disableGPSDialog();
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets up the UI handler.
|
* Sets up the UI handler. The UI handler will process messages from
|
||||||
* The UI handler will process messages from processing threads
|
* processing threads
|
||||||
*
|
*
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
@@ -478,8 +460,10 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
mDistance.setText((String) msg.obj);
|
mDistance.setText((String) msg.obj);
|
||||||
break;
|
break;
|
||||||
case FOUND_CAR:
|
case FOUND_CAR:
|
||||||
/* remove the directions overlay & delete all navigation files when the car is found
|
/*
|
||||||
* this will prevent old directions from being displayed after the car is found.
|
* remove the directions overlay & delete all navigation
|
||||||
|
* files when the car is found this will prevent old
|
||||||
|
* directions from being displayed after the car is found.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (mDirections != null) {
|
if (mDirections != null) {
|
||||||
@@ -487,12 +471,16 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
mDirections = null;
|
mDirections = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vibrator vib = (Vibrator) getActivity().getSystemService(Context.VIBRATOR_SERVICE);
|
Vibrator vib = (Vibrator) getActivity().getSystemService(
|
||||||
|
Context.VIBRATOR_SERVICE);
|
||||||
new AlertDialog.Builder(getActivity())
|
new AlertDialog.Builder(getActivity())
|
||||||
.setTitle(R.string.yay)
|
.setTitle(R.string.yay)
|
||||||
.setMessage(R.string.found_car).setCancelable(false)
|
.setMessage(R.string.found_car)
|
||||||
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
.setCancelable(false)
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
.setPositiveButton(R.string.ok,
|
||||||
|
new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(
|
||||||
|
DialogInterface dialog, int id) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}).show();
|
}).show();
|
||||||
@@ -505,7 +493,7 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
case MIDPOINT:
|
case MIDPOINT:
|
||||||
MidPoint mp = (MidPoint) msg.obj;
|
MidPoint mp = (MidPoint) msg.obj;
|
||||||
panToGeoPoint(mp.getMidPoint(), false);
|
panToGeoPoint(mp.getMidPoint(), false);
|
||||||
mp.zoomToSpan(mMapView);
|
mp.zoomToSpan(mMap.getMap());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -514,32 +502,38 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* computes a geopoint the is the central geopoint between the user and the car.
|
* computes a geopoint the is the central geopoint between the user and the
|
||||||
* also it zooms so both marks are visible on the map
|
* car. also it zooms so both marks are visible on the map
|
||||||
|
*
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
protected void showBoth() {
|
protected void showBoth() {
|
||||||
if(mUserOverlay != null) {
|
if (mMap != null) {
|
||||||
if (mCarPoint == null) {
|
if (mCarPoint == null) {
|
||||||
Toast.makeText(getActivity(), R.string.mark_car_first, Toast.LENGTH_LONG).show();
|
Toast.makeText(getActivity(), R.string.mark_car_first,
|
||||||
} else if (mUserOverlay.getUserLocation() == null){
|
Toast.LENGTH_LONG).show();
|
||||||
Toast.makeText(getActivity(), R.string.no_gps_signal, Toast.LENGTH_LONG).show();
|
} else if (mMap.getUserLocation() == null) {
|
||||||
|
Toast.makeText(getActivity(), R.string.no_gps_signal,
|
||||||
|
Toast.LENGTH_LONG).show();
|
||||||
} else {
|
} else {
|
||||||
if (mMapView != null) {
|
if (mMap.getMap() != null) {
|
||||||
mMapView.getController().stopAnimation(false);
|
mMap.getMap().getController().stopAnimation(false);
|
||||||
mUserOverlay.followUser(false);
|
mMap.followUser(false);
|
||||||
// isShowingBoth = true;
|
// isShowingBoth = true;
|
||||||
final GeoPoint user = mUserOverlay.getUserLocation();
|
final GeoPoint user = mMap.getUserLocation();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* here we null check our next set of value before we send them off to geoutils
|
* here we null check our next set of value before we send
|
||||||
* if they have became null for some reason we disable show both mode
|
* them off to geoutils if they have became null for some
|
||||||
|
* reason we disable show both mode
|
||||||
*/
|
*/
|
||||||
if (mCarPoint != null && user != null) {
|
if (mCarPoint != null && user != null) {
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
mHandler.sendMessage(mHandler.obtainMessage(MIDPOINT, GeoUtils.midPoint(mCarPoint, user)));
|
mHandler.sendMessage(mHandler.obtainMessage(
|
||||||
|
MIDPOINT,
|
||||||
|
GeoUtils.midPoint(mCarPoint, user)));
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
|
|
||||||
@@ -547,9 +541,8 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
// else
|
// else
|
||||||
// isShowingBoth = false;
|
// isShowingBoth = false;
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Log.e(TAG, "showBoth.mMapView is null");
|
Log.e(TAG, "showBoth.mMap.getMap() is null");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -557,6 +550,7 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the listener for this map fragment
|
* Sets the listener for this map fragment
|
||||||
|
*
|
||||||
* @param listener
|
* @param listener
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
@@ -580,28 +574,33 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
if (!Main.isFull)
|
if (!Main.isFull)
|
||||||
Main.featureInFullDialog(getActivity());
|
Main.featureInFullDialog(getActivity());
|
||||||
else
|
else
|
||||||
getActivity().startActivity(new Intent(getActivity(), ParkignTimerActivity.class));
|
getActivity().startActivity(
|
||||||
|
new Intent(getActivity(), ParkignTimerActivity.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Marks the user's location
|
* Marks the user's location
|
||||||
|
*
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
private void markMyLocation() {
|
private void markMyLocation() {
|
||||||
mUserOverlay.followUser(true);
|
mMap.followUser(true);
|
||||||
// isShowingBoth = false;
|
// isShowingBoth = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if we have a gps signal, then pan to user location and then
|
* if we have a gps signal, then pan to user location and then if there
|
||||||
* if there is no car, mark the car location as the users location
|
* is no car, mark the car location as the users location else show mark
|
||||||
* else show mark car dialog
|
* car dialog
|
||||||
|
*
|
||||||
|
* we switch from MyLocationOverlay.getMyLocation() to referencing the
|
||||||
|
* static variable MyCustomLocationOverlay.gpUser because for some
|
||||||
|
* reason getMyLocation() would become null.
|
||||||
*
|
*
|
||||||
* we switch from MyLocationOverlay.getMyLocation() to referencing the static variable MyCustomLocationOverlay.gpUser
|
|
||||||
* because for some reason getMyLocation() would become null.
|
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
if (! panToGeoPoint(mUserOverlay.getUserLocation(), true)){
|
if (!panToGeoPoint(mMap.getUserLocation(), true)) {
|
||||||
Toast.makeText(getActivity(), R.string.no_gps_signal, Toast.LENGTH_LONG).show();
|
Toast.makeText(getActivity(), R.string.no_gps_signal,
|
||||||
|
Toast.LENGTH_LONG).show();
|
||||||
} else {
|
} else {
|
||||||
if (mCarPoint != null) {
|
if (mCarPoint != null) {
|
||||||
markCarDialog();
|
markCarDialog();
|
||||||
@@ -613,37 +612,43 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* pans the map to the user's location
|
* pans the map to the user's location
|
||||||
|
*
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
private void myLocation() {
|
private void myLocation() {
|
||||||
mUserOverlay.followUser(true);
|
mMap.followUser(true);
|
||||||
// isShowingBoth = false;
|
// isShowingBoth = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if we have a gps signal, then pan to user location
|
* if we have a gps signal, then pan to user location else notify user
|
||||||
* else notify user that there is no GPS signal
|
* that there is no GPS signal
|
||||||
|
*
|
||||||
|
* we switch from MyLocationOverlay.getMyLocation() to referencing the
|
||||||
|
* static variable MyCustomLocationOverlay.gpUser because for some
|
||||||
|
* reason getMyLocation() would become null.
|
||||||
*
|
*
|
||||||
* we switch from MyLocationOverlay.getMyLocation() to referencing the static variable MyCustomLocationOverlay.gpUser
|
|
||||||
* because for some reason getMyLocation() would become null.
|
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
if (! panToGeoPoint(mUserOverlay.getUserLocation(), true)){
|
if (!panToGeoPoint(mMap.getUserLocation(), true)) {
|
||||||
Toast.makeText(getActivity(), R.string.no_gps_signal, Toast.LENGTH_LONG).show();
|
Toast.makeText(getActivity(), R.string.no_gps_signal,
|
||||||
|
Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays the walking directions on the map
|
* Displays the walking directions on the map
|
||||||
|
*
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
private void directions() {
|
private void directions() {
|
||||||
if (Main.isFull) {
|
if (Main.isFull) {
|
||||||
/*
|
/*
|
||||||
* if there is no car marked, then notify user
|
* if there is no car marked, then notify user else check to see if
|
||||||
* else check to see if there is directions
|
* there is directions
|
||||||
*/
|
*/
|
||||||
if (mCarPoint == null) {
|
if (mCarPoint == null) {
|
||||||
Toast.makeText(getActivity(), R.string.mark_car_first, Toast.LENGTH_LONG).show();
|
Toast.makeText(getActivity(), R.string.mark_car_first,
|
||||||
|
Toast.LENGTH_LONG).show();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -653,18 +658,23 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
mDirections.removePath();
|
mDirections.removePath();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if there is no location fix then notify user
|
* if there is no location fix then notify user else download
|
||||||
* else download directions and display them
|
* directions and display them
|
||||||
*/
|
*/
|
||||||
if (mUserOverlay.getUserLocation() == null) {
|
if (mMap.getUserLocation() == null) {
|
||||||
Toast.makeText(getActivity(), R.string.no_gps_signal, Toast.LENGTH_LONG).show();
|
Toast.makeText(getActivity(), R.string.no_gps_signal,
|
||||||
|
Toast.LENGTH_LONG).show();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
mProgress = ProgressDialog.show(getActivity(), getText(R.string.directions), getText(R.string.calculating), true);
|
mProgress = ProgressDialog.show(getActivity(),
|
||||||
|
getText(R.string.directions),
|
||||||
|
getText(R.string.calculating), true);
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notifys user about the error that occurred outside of the UI thread
|
* Notifys user about the error that occurred outside of
|
||||||
|
* the UI thread
|
||||||
|
*
|
||||||
* @param e
|
* @param e
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
@@ -673,7 +683,9 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_LONG).show();
|
Toast.makeText(getActivity(),
|
||||||
|
e.getMessage(), Toast.LENGTH_LONG)
|
||||||
|
.show();
|
||||||
mProgress.dismiss();
|
mProgress.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -682,7 +694,7 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
mDirections = new DirectionsOverlay(mMapView, mUserOverlay.getUserLocation(), mCarPoint, MapFragment.this);
|
mDirections = new DirectionsOverlay(mMap.getMap(), mMap.getUserLocation(), mCarPoint, MapFragment.this);
|
||||||
} catch (IllegalStateException e) {
|
} catch (IllegalStateException e) {
|
||||||
notify(e);
|
notify(e);
|
||||||
} catch (ClientProtocolException e) {
|
} catch (ClientProtocolException e) {
|
||||||
@@ -704,11 +716,12 @@ public class MapFragment extends Fragment implements GeoPointLocationListener, O
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* changes the map mode
|
* changes the map mode
|
||||||
|
*
|
||||||
* @author ricky barrette
|
* @author ricky barrette
|
||||||
*/
|
*/
|
||||||
private void changeMapMode() {
|
private void changeMapMode() {
|
||||||
if(mMapView != null)
|
if (mMap.getMap() != null)
|
||||||
mMapView.setSatellite(!mMapView.isSatellite());
|
mMap.getMap().setSatellite(!mMap.getMap().isSatellite());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user