I
I
iMahach2015-01-22 09:19:44
Android
iMahach, 2015-01-22 09:19:44

How to open a map of a specific city in Google Maps?

Hello, I am developing a taxi application that works in a certain city, but GoogleMaps opens a map of the whole world. How to open a map of one city?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
yanchumak, 2015-01-22
@iMahach

Geocoder geocoder = new Geocoder(<your context>);  
List<Address> addresses;
addresses = geocoder.getFromLocationName(<String address>, 1);
if(addresses.size() > 0) {
    double latitude= addresses.get(0).getLatitude();
    double longitude= addresses.get(0).getLongitude();
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question