Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void clickMetoFindPlaceFunction(View view) {
- EditText userText = (EditText) findViewById(R.id.findMe);
- String location = userText.getText().toString();
- List<Address> addressList = null;
- String[] tab = new String[2];
- for (int i = 0; i < tab.length; i++) {
- tab[i] = location;
- }
- for (int i = 0; i < 1; i++) {
- System.out.println(tab[i]);
- }
- if (location != null || !location.equals("")) {
- Geocoder geocoder = new Geocoder(this);
- try {
- addressList = geocoder.getFromLocationName(location, 1);
- } catch (IOException e) {
- e.printStackTrace();
- }
- Address address = addressList.get(0);
- LatLng findMe = new LatLng(address.getLatitude(), address.getLongitude());
- mAlkoMap.addMarker(new MarkerOptions().position(findMe.).title("your position"));
- mAlkoMap.moveCamera(CameraUpdateFactory.newLatLng(findMe));
- mAlkoMap.setBuildingsEnabled(true);
- mAlkoMap.animateCamera(CameraUpdateFactory.newLatLngZoom(findMe, 17));
- }
- }
- public void viewOfBuldings() {
- mAlkoMap.animateCamera(CameraUpdateFactory.newLatLngZoom(findMe, 17));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement