@Override
public void onLocationChanged(Location location) {
if (myLocationListener != null) {
myLocationListener.onLocationChanged(location);
double lat = location.getLatitude();
double lon = location.getLongitude();
tvLocInfo.setText(
"lat: " + lat + "\n" +
"lon: " + lon);
LatLng latlng= new LatLng(location.getLatitude(), location.getLongitude());
myMap.animateCamera(CameraUpdateFactory.newLatLng(latlng));
}
}
The series:
A simple example using Google Maps Android API v2, step by step.
![Detect and animate to user location thumbnail](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGXB_y-wk8iilVKl3g258SA2_cQkg0n6KplSczkjpEKjr-ls8zcTA4hrZxmT4QyV0KmQBkLfeCjBVeCBxQW-p2X4YobRId_5DmmYd1-Xpzb0BzQ_qj1rzESBHGd8JVbd4_0VagplqT1Xc/s72-c/AndroidMapsV2_animateCamera_to_myLocation.png)
Title: Detect and animate to user location
Rating: 100% based on 99998 ratings. 10 user reviews.
Post by 11:19 AM
Rating: 100% based on 99998 ratings. 10 user reviews.
Post by 11:19 AM
0 comments:
Post a Comment