简体   繁体   English

Flutter 和谷歌地点 API 结果

[英]Flutter and google places API results

hope someone can help me with this.希望有人可以帮助我。

I've managed to return search autocomplete results and for the most part everything is ok and results are almost restricted to the area but ocassionaly I get areas outside of the radius when non of the queried letters match the area.我已经设法返回搜索自动完成结果,并且在大多数情况下一切正常,结果几乎仅限于该区域,但有时当查询的字母不匹配该区域时,我会得到半径之外的区域。

However I want to apply restrictions to display results that are only in the specified area/radius.但是我想应用限制来显示仅在指定区域/半径内的结果。 I've tried applying strictbounds parameter, but strictbounds combined with types: 'address' is just showing no results or single result.我试过应用 strictbounds 参数,但 strictbounds 与 types: 'address' 结合使用时没有显示任何结果或只有一个结果。 When I remove types the results automatically show only points of interest which I don't need.当我删除类型时,结果会自动仅显示我不需要的兴趣点。 Only need addresses.只需要地址。

Anyone have any idea whats wrong in this?任何人都知道这有什么问题吗?

Uri uri = Uri.https("maps.googleapis.com", "maps/api/place/autocomplete/json", {
  "input": query,
  "location": poznanLocation,
  "language": "pl",
  "radius": searchRadius,
  "key": apiKey,
  "bounds": "52.22,15.33|53.13,17.36",
  "strictbounds": "true",
  "types": "address",
  "sessiontoken": _sessionToken,
});

Are you sure there are suitable results that should be returned?您确定应该返回合适的结果吗?

Depending on the values of location and radius (*), there may be no suitable results left after adding both strictbounds and types=address .根据locationradius (*) 的值,添加strictboundstypes=address strictbounds可能没有合适的结果。

If results are returned when removing strictbounds , are they strictly within the region defined by location and radius ?如果在删除strictbounds时返回结果,它们是否严格locationradius定义的区域内? If they are, please file a bug .如果是,请提交错误 Otherwise, that is precisely the intended behavior of strictbounds .否则,这正是strictbounds的预期行为。

(*) The Place Autocomplete web service will ignore the bounds parameter, because it is not supported. (*) Place Autocomplete web 服务将忽略bounds参数,因为它不受支持。

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

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