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

  • Dirty Loops

    Dirty Loops

    21 Mayıs 2007
  • L33TNoonProductions

    L33TNoonProd

    24 EYLÜL 2010
  • Theodore Leaf

    Theodore Lea

    29 AĞUSTOS 2006