简体   繁体   English

如何通过邮政编码在特定国家/地区上找到Google地图上的地点

[英]How to find a place on google map by postal code for specific country

This method used to work for me before: when I have a postal code, I just add it to the end of the following link: 此方法曾经为我工作过:当我拥有邮政编码时,只需将其添加到以下链接的末尾:

https://www.google.com/maps?q=

eg. 例如。 postal code is 649414 then I can view the location by: 邮政编码是649414,那么我可以通过以下方式查看位置:

https://www.google.com/maps?q=649414

But after a while, I recognised that it won't show the right place any more. 但是过了一会儿,我意识到它不再显示正确的位置。 The reason could be there are several places on the world have the same postal code. 原因可能是世界上有多个地方的邮政编码相同。 So it just show an area (like US) or a different place from what I expected. 因此,它仅显示一个区域(例如美国)或与我期望的区域不同的地方。 So if I want to be precise, I need to click another result on the page to choose my region. 因此,如果我想精确一点,我需要单击页面上的另一个结果以选择我的地区。 My question is, is there any way I could automatically narrow the search for a specific country, say Singapore ? 我的问题是,新加坡有什么办法可以自动缩小对特定国家的搜索范围? If you search for postal code like : 272012 , it will have 2 results at Singapore and Shandong - China. 如果您搜索邮政编码:272012,它将在新加坡和中国山东有2个结果。 but the link on the address bar is the same: 但是地址栏上的链接是相同的:

https://www.google.com/maps?q=272012

How could I set in my code in php to make it redirect to this page: 我如何在php中设置代码以使其重定向到此页面:

https://www.google.com/maps?q=272012

but only in Singapore ? 但仅在新加坡?

Just add the location name and "+" before the postal code: 只需在邮政编码之前添加位置名称和“ +”即可:

https://maps.google.com/maps?q=Singapore+272012 https://maps.google.com/maps?q=新加坡+272012

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM