如何获取谷歌地图上几个地方的地址,这些地方显示不可用给定的lat,lng

时间:2022-06-21 09:34:28

I am facing a problem which relates to geocoding in which using google geocode map api with given lat,lng (for example 32.983025 75.710981),the return result gives status as ZERO_RESULT. How can we handle this find to find the address for that particular lat,lng, which should be understandable by the end user.

我正面临一个与地理编码有关的问题,其中使用谷歌地理编码地图api与给定的lat,lng(例如32.983025 75.710981),返回结果给出状态为ZERO_RESULT。我们如何处理此查找以找到特定lat的地址lng,这应该是最终用户可以理解的。

如何获取谷歌地图上几个地方的地址,这些地方显示不可用给定的lat,lng

2 个解决方案

#1


0  

You can check the status of the returned result. If the status is not OK then you can give an error message saying that the address was not found.

您可以检查返回结果的状态。如果状态不正常,那么您可以给出一条错误消息,指出找不到该地址。

<status>OK</status>

You can also validate the input and inform the user that it needs to be in "lat, lon" format

您还可以验证输入并通知用户它需要采用“lat,lon”格式

#2


0  

Can check the status but it will be not user friendly as the address might be there but google map doesn't suggest any address as it might not be added or it might be newly added to map. So in order to handle you will check the status from the geode api and validate before showing to the end user.

可以检查状态,但它不是用户友好的,因为地址可能在那里,但谷歌地图不建议任何地址,因为它可能没有添加或可能是新添加到地图。因此,为了处理,您将在显示给最终用户之前检查geode api中的状态并进行验证。

#1


0  

You can check the status of the returned result. If the status is not OK then you can give an error message saying that the address was not found.

您可以检查返回结果的状态。如果状态不正常,那么您可以给出一条错误消息,指出找不到该地址。

<status>OK</status>

You can also validate the input and inform the user that it needs to be in "lat, lon" format

您还可以验证输入并通知用户它需要采用“lat,lon”格式

#2


0  

Can check the status but it will be not user friendly as the address might be there but google map doesn't suggest any address as it might not be added or it might be newly added to map. So in order to handle you will check the status from the geode api and validate before showing to the end user.

可以检查状态,但它不是用户友好的,因为地址可能在那里,但谷歌地图不建议任何地址,因为它可能没有添加或可能是新添加到地图。因此,为了处理,您将在显示给最终用户之前检查geode api中的状态并进行验证。