Reputation: 3
I have a problem with using Google Maps API. I use a geolocation service for the coordination of streets, but faced with the problem. When I select a street that I need API does not calculate right the coordinates of the street. JSON response shows that the API search only city. This situation only occurs with some streets.
http://maps.googleapis.com/maps/api/geocode/json?address=1+Schorsa+Kyiv&sensor=false
{ "results" : [ { "address_components" : [ { "long_name" : "Kiev", "short_name" : "Kiev", "types" : [ "locality", "political" ] }, { "long_name" : "Kiev city", "short_name" : "Kiev city", "types" : [ "administrative_area_level_2", "political" ] }, { "long_name" : "Kyiv city", "short_name" : "Kyiv city", "types" : [ "administrative_area_level_1", "political" ] }, { "long_name" : "Ukraine", "short_name" : "UA", "types" : [ "country", "political" ] } ], "formatted_address" : "Kiev, Kyiv city, Ukraine", "geometry" : { "bounds" : { "northeast" : { "lat" : 50.590798, "lng" : 30.825941 }, "southwest" : { "lat" : 50.213273, "lng" : 30.2394401 } }, "location" : { "lat" : 50.4501, "lng" : 30.5234 }, "location_type" : "APPROXIMATE", "viewport" : { "northeast" : { "lat" : 50.590798, "lng" : 30.825941 }, "southwest" : { "lat" : 50.213273, "lng" : 30.2394401 } } }, "partial_match" : true, "types" : [ "locality", "political" ] } ], "status" : "OK" }
If you click the link that I send it in a browser
{
"results" : [
{
"address_components" : [
{
"long_name" : "1",
"short_name" : "1",
"types" : [ "street_number" ]
},
{
"long_name" : "улица Щорса",
"short_name" : "улица Щорса",
"types" : [ "route" ]
},
{
"long_name" : "Деснянский район",
"short_name" : "Деснянский район",
"types" : [ "sublocality", "political" ]
},
{
"long_name" : "Киев",
"short_name" : "Киев",
"types" : [ "locality", "political" ]
},
{
"long_name" : "город Киев",
"short_name" : "город Киев",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "город Киев",
"short_name" : "город Киев",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "Украина",
"short_name" : "UA",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "улица Щорса, 1, Киев, город Киев, Украина",
"geometry" : {
"location" : {
"lat" : 50.52287399999999,
"lng" : 30.59185099999999
},
"location_type" : "ROOFTOP",
"viewport" : {
"northeast" : {
"lat" : 50.5242229802915,
"lng" : 30.59319998029149
},
"southwest" : {
"lat" : 50.5215250197085,
"lng" : 30.5905020197085
}
}
},
Upvotes: 0
Views: 177
Reputation: 161334
Add "Street" to the name of the street
http://maps.googleapis.com/maps/api/geocode/json?address=1+Schorsa+Street+Kyiv&sensor=false
Upvotes: 0