https://maps.googleapis.com/maps/api/geocode/json?address= & key = Bạn phải vượt qua chính dịch vụ API Google của bạn để URL trên thì bạn sẽ nhận được
kết quả ở định dạng json như:
{
"results" : [
{
"address_components" : [
{
"long_name" : "Mumbai",
"short_name" : "Mumbai",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Maharashtra",
"short_name" : "MH",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "India",
"short_name" : "IN",
"types" : [ "country", "political" ]
},
{
"long_name" : "400093",
"short_name" : "400093",
"types" : [ "postal_code" ]
}
],
"formatted_address" : "Udyog Sarathi, Mahakali Caves Road, Marol Industrial Area, Andheri East, Mumbai, Maharashtra 400093, India",
"geometry" : {
"location" : {
"lat" : 19.1254233,
"lng" : 72.8665118
},
"location_type" : "GEOMETRIC_CENTER",
"viewport" : {
"northeast" : {
"lat" : 19.1267722802915,
"lng" : 72.86786078029151
},
"southwest" : {
"lat" : 19.1240743197085,
"lng" : 72.8651628197085
}
}
},
"place_id" : "ChIJ02N9eyPI5zsRMEB_9ivO_B0",
"types" : [ "establishment", "point_of_interest" ]
}
],
"status" : "OK"
}
Hình học chứa vị trí như định dạng lat lon.