为什么“natural_feature”从Google地图地理编码和Places API搜索中排除? [英] Why is "natural_feature" excluded from Google Maps Geocoding and Places API searches?

查看:165
本文介绍了为什么“natural_feature”从Google地图地理编码和Places API搜索中排除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图在我自己的网站上模仿Google地图的这里有什么功能,但Google Maps 3 API地理编码中似乎排除了natural_feature类型的项目,并且会在附近和雷达上以及文本中进行搜索搜索除非提供该地点的确切名称。这一定是Google做出的明智选择 - 任何人都知道理由,更好的是提供解决方法?看起来很疯狂,我无法得到树林,自然保护区等的名字......

解决方案

去做吧!如果您从Google获得地理编码API密钥,则可以从服务器请求中获取包含在JSON / XML响应中的自然功能的所有数据,如下所示(我试图获取Gamsey Wood的数据):



https://maps.googleapis.com/maps/api/geocode/json?latlng=52.4180698,-0.2029999&result_type=natural_feature&key=YOUR_GOOGLE_GEO_KEY



快乐的日子!

Trying to mimic the 'what's here' feature of Google Maps in my own website but it seems that items of type 'natural_feature' are excluded from Google Maps 3 API geocoding and places searches, both nearby and radar, and also on text searches unless the EXACT name of the place is provided. This must have been an informed choice by Google to do this - anyone know the rationale, and better, offer a workaround? Seems crazy that I can't get the names of woods, nature reserves etc. any more...

解决方案

Found out how to do it! If you get a geocoding API key from Google you can get all the data for natural features included in the JSON/XML response from a server request like the following (I was trying to get the data for "Gamsey Wood"):

https://maps.googleapis.com/maps/api/geocode/json?latlng=52.4180698,-0.2029999&result_type=natural_feature&key=YOUR_GOOGLE_GEO_KEY

Happy days!

这篇关于为什么“natural_feature”从Google地图地理编码和Places API搜索中排除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆