【问题标题】:Limit places autocomplete to a certain language将地点自动完成限制为某种语言
【发布时间】:2013-05-30 12:08:31
【问题描述】:

我正在使用 Google Maps API 3(Places Librairy)来允许网站用户将位置附加到他们上传的照片中。

我开始使用这个例子:https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete

一切都像一个魅力,除了:我希望结果集是一种特定的语言(法语)。请注意,我不想将结果限制在特定区域。 我想翻译结果,即用“Pékin, Chine”而不是“Beijing, China”。

您是否介意解释一下代码中要更改的内容,或者指出正确的方向?

非常感谢!

【问题讨论】:

    标签: google-maps google-maps-api-3 geolocation


    【解决方案1】:

    在包含 maps-API 时添加 language-参数:

    https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places&language=fr
    

    https://developers.google.com/maps/documentation/javascript/basics#Language

    【讨论】:

    • 这正是我所需要的。非常感谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多