谷歌地图的API:英国具体成果 [英] Google Map APIs : UK specific results

查看:173
本文介绍了谷歌地图的API:英国具体成果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发Android中地图应用。我使用谷歌地图API来显示自动完成结果的TextView下拉列表中。结果此API返回的是整个世界的地方。我想显示结果○只有一个特定国家的地方如.UK提供解决方案
   我应该怎么做。是否有它被设置的任何特定的标志。

I'm developing a map application in Android. I'm using Google maps API to show results in Autocomplete textview dropdown .The results this API is returning is of the places of the entire world . I want to show results o provide solutions to places only of a particular country eg .UK How should I do it . Is there any specific flag to be set for it .

我的网址:
私有静态字符串SUGGETION_URL = \"https://maps.googleapis.com/maps/api/place/autocomplete/json?input=%s&types=geo$c$c&sensor=true&key=xxxxx.xxx-xxxxx\";

请建议如何通过此URL将返回结果仅在英国地方呢?

Please suggest ways by which this url will return results to places only in UK ?

推荐答案

有没有办法强制API就像你可以在一些其他的谷歌地图的Web服务的API来限制它的结果的区域。如果你真的需要这个功能,那么也许你应该使用地理编码 API或地方自动完成API作为包括谷歌地图JS V3的API中。

There's no way to force the API to restrict it's results to a region like you can in some of the other Google Maps Web Service APIs. If you really need that functionality then maybe you should be using the Geocoding API or the Places Autocomplete API as included in the Google Maps JS V3 API.

如果您不能使用的这两个建议,你的选择是有限的:

If you can't use either of those two suggestions your options are limited to:


  1. 您可以使用位置/半径的 的参数,像你这样的发现,但被视为更像是建议不是绝对的。

  1. You can use the location / radius parameters like you found, but there are treated as more like "suggestions" than absolutes.

我想尝试的语言参数设置为 EN-GB 这可能有利于略高于其他英国的结果。

I'd try setting the language parameter to en-GB which might favor UK-based results slightly over others.

这篇关于谷歌地图的API:英国具体成果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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