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

  • CHISTOSITOJAJA

    CHISTOSITOJA

    27 HAZİRAN 2010
  • Excel Video Tutorials

    Excel Video

    6 Aralık 2012
  • MultiPlayStationMan

    MultiPlaySta

    17 Aralık 2009