Advertisement
patrykszczur

Untitled

May 10th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. public void clickMetoFindPlaceFunction(View view) {
  2. EditText userText = (EditText) findViewById(R.id.findMe);
  3. String location = userText.getText().toString();
  4. List<Address> addressList = null;
  5. String[] tab = new String[2];
  6. for (int i = 0; i < tab.length; i++) {
  7. tab[i] = location;
  8. }
  9. for (int i = 0; i < 1; i++) {
  10.  
  11. System.out.println(tab[i]);
  12. }
  13. if (location != null || !location.equals("")) {
  14. Geocoder geocoder = new Geocoder(this);
  15. try {
  16. addressList = geocoder.getFromLocationName(location, 1);
  17. } catch (IOException e) {
  18. e.printStackTrace();
  19. }
  20. Address address = addressList.get(0);
  21. LatLng findMe = new LatLng(address.getLatitude(), address.getLongitude());
  22. mAlkoMap.addMarker(new MarkerOptions().position(findMe.).title("your position"));
  23. mAlkoMap.moveCamera(CameraUpdateFactory.newLatLng(findMe));
  24. mAlkoMap.setBuildingsEnabled(true);
  25. mAlkoMap.animateCamera(CameraUpdateFactory.newLatLngZoom(findMe, 17));
  26.  
  27. }
  28. }
  29.  
  30. public void viewOfBuldings() {
  31.  
  32. mAlkoMap.animateCamera(CameraUpdateFactory.newLatLngZoom(findMe, 17));
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement