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

  • CaliforniaMetin

    CaliforniaMe

    3 ŞUBAT 2013
  • jpmkm1

    jpmkm1

    4 NİSAN 2008
  • soyacincautv

    soyacincautv

    14 NİSAN 2010