Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. private void buildLocationCallback() {
  2. foregroundlocationcallback = new LocationCallback() {
  3. @SuppressLint("MissingPermission")
  4. @Override
  5. public void onLocationResult(LocationResult locationResult) {
  6.  
  7. super.onLocationResult(locationResult);
  8. for (Location location : locationResult.getLocations()) {
  9. Log.d("currentlocation", "foregroundlocation" + location.getLatitude());
  10. curretLatLng = new LatLng(location.getLatitude(),
  11. location.getLongitude());
  12. currenttruelatlong = new LatLng(location.getLatitude(),
  13. location.getLongitude());
  14. isSource = true;
  15. setMarker(curretLatLng, isSource);
  16. map.setMyLocationEnabled(true);;
  17. setMarkerOnRoad(curretLatLng, curretLatLng);
  18. animateCameraToMarker(curretLatLng, true);
  19. }
  20.  
  21.  
  22. }
  23. };
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement