Reputation: 519
I have the string - "Moscow".
How to get a Gpoint (coords) from the my string?
I need result about : new GPoint(30.3112,59.99322);
Upvotes: 1
Views: 1588
Reputation: 3712
The Google Geocoding API will do the job for you, description and examples here: http://code.google.com/apis/maps/documentation/geocoding/
Upvotes: 0
Reputation: 13590
Well, v2 API says that GPoint does not represent a point on Earth by geographical coordinates but GLatLng does.
To get coordinates you need to use geocoding:
geocoder = new GClientGeocoder();
geocoder.getLatLng("Moscow", function(point)
{
if (point == null)
{
// nothing found
}
else
{
// point is an instance of GLatLng with coordinates you need
}
});
Upvotes: 2