public void setUpMap() { mGoogleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE); if (mAppPrefs.getCurrLat() != 0 & mAppPrefs.getCurrLong() != 0) { LatLng latLng = new LatLng(mAppPrefs.getCurrLat(), mAppPrefs.getCurrLong()); MarkerOptions options = new MarkerOptions().position(latLng).title("I am here!"); mGoogleMap.addMarker(options); mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 25)); } }
@Override public void handleNewLocation(Location location) { double currentLatitude = location.getLatitude(); double currentLongitude = location.getLongitude(); if (currentLatitude != 0 & currentLongitude != 0) { mAppPrefs.saveCurrLat(currentLatitude); mAppPrefs.saveCurrLong(currentLongitude); LatLng latLng = new LatLng(mAppPrefs.getCurrLat(), mAppPrefs.getCurrLong()); MarkerOptions options = new MarkerOptions().position(latLng).title("I am here!"); mGoogleMap.addMarker(options); mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 15)); } }