Skip to content

Commit

Permalink
updated LandActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
till-tomorrow committed Apr 9, 2018
1 parent 4de3a54 commit b28a0cc
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ public void onClick(View v) {
.findFragmentById(R.id.mainMapView);
mapFragment.getMapAsync(this);


}

@Override
Expand Down Expand Up @@ -309,6 +310,10 @@ public void handleTask(String activity, String type, String vehname, String vehk
@Override
public void onMapReady(GoogleMap googleMap) {
mGoogleMap = googleMap;

//to zoom in
mGoogleMap.setOnCameraMoveStartedListener(this);
mGoogleMap.setMaxZoomPreference(14.0f);

if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
Expand All @@ -323,6 +328,16 @@ public void onMapReady(GoogleMap googleMap) {
mGoogleMap.setMyLocationEnabled(true);
}

@Override
public void onCameraMoveStarted(int reason) {

if (reason == OnCameraMoveStartedListener.REASON_GESTURE) {
mGoogleMap.animateCamera(CameraUpdateFactory.zoomIn());
Toast.makeText(this, "The user gestured on the map.",
Toast.LENGTH_SHORT).show();
}
}

@Override
public void onLocationChanged(Location location) {
LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
Expand Down

0 comments on commit b28a0cc

Please sign in to comment.