Google Maps Geocoding API limit result

257 Views Asked by At

I am using Google Maps Geocoding API in C# to get lat lng using provided address.

For some addresses string, I am getting 10 or more results, which cause below exception in the “EndGetResponse” method,

“AsyncWaitHandle 'result.AsyncWaitHandle' threw an exception of type 'System.NotSupportedException'”

I am getting exception only for 2-3 addresses for remaining addresses everything works fine.

Can I restrict result count in Geocode API or any pointer. Thanks in advance.

Regards, Omkar

1

There are 1 best solutions below

0
On BEST ANSWER

Used alternative to use Google maps JavaScript Geocode service to get lat/lng if exception occurred with APIs.

Regards, Omkar