Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update LandActivity.java #138

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@ Google Code-in users should checkout the **c_in_refine** branch for all tasks.

You'll have all the necessary information to procede in there.

## Code of Conduct and Contribution Practices

Please help us follow the best practice to make it easy for the reviewer as well as the contributor.
We want to focus on the code quality more than on managing pull request ethics. Follow [Github Flow](https://help.github.com/articles/github-flow/).

- [People before code](http://hintjens.com/blog:95): If any of the following rules are violated, the pull-requests must not be rejected. This is to create an easy and joyful onboarding process for new programmers and first-time contributors.

- Single commit per pull request and name the commit as something meaningful

- Reference the issue numbers in the commit message if it resolves an open issue. Follow the pattern `Fixes #<issue number> <commit message>`

- Provide relevant screenshot for easier review.

- In case there are multiple commits on the PR, the commit author should squash them.

- Avoid duplicate PRs, if need be comment on the older PR with the PR number of the follow-up (new PR) and close the obsolete PR yourself.

Happy Contributing!

## License

Expand Down
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);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the additional new line.

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