SORU
26 AĞUSTOS 2010, PERŞEMBE


Nasıl adresinden enlem ve boylam bulabilirim?

Google maps'te, bir adres yerini göstermek istiyorum.

Nasıl bir adres Google Maps API kullanarak enlem ve boylam alabilirim?

CEVAP
26 AĞUSTOS 2010, PERŞEMBE


public GeoPoint getLocationFromAddress(String strAddress){

Geocoder coder = new Geocoder(this);
List<Address> address;
GeoPoint p1 = null;

try {
    address = coder.getFromLocationName(strAddress,5);
    if (address == null) {
        return null;
    }
    Address location = address.get(0);
    location.getLatitude();
    location.getLongitude();

    p1 = new GeoPoint((int) (location.getLatitude() * 1E6),
                      (int) (location.getLongitude() * 1E6));

    return p1;
}

strAddress bir dize içeren Adres. address değişken dönüştürülmüş adreslerini tutar.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Ben Vivona

    Ben Vivona

    24 Ocak 2010
  • GFX Tutorials

    GFX Tutorial

    12 AĞUSTOS 2013
  • International Secret Agents Concerts

    Internationa

    2 Aralık 2008