|
|
|
Android - จะแปลง Address เป็น latitude, longitude ยังไง. |
|
|
|
|
|
|
|
ใช้ Geocoder ครับ
Code (Android-Java)
Geocoder coder = new Geocoder(this);
List<Address> address;
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;
}
ที่เหลือ ไปอ่านดูครับ
- http://developer.android.com/training/location/display-address.html
- http://stackoverflow.com/questions/3574644/how-can-i-find-the-latitude-and-longitude-from-address
|
|
|
|
|
Date :
2014-03-21 18:06:46 |
By :
devahoy |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|