简体   繁体   English

如何使用Google Maps API V2 for android获取不同语言的地图

[英]How to get a map in different languages using Google maps API V2 for android

I'm building an application using Google Maps Android API v2 and i'm able to get the map: 我正在使用Google Maps Android API v2构建应用程序,我可以获取地图:

private void initMap() {
        SupportMapFragment mf = (SupportMapFragment) getSupportFragmentManager()
                .findFragmentById(R.id.map);
        map = mf.getMap();                      
    }

The thing is, my app should support many languages and i was wondering if it's possible to get a map in different languages according to locale? 问题是,我的应用程序应支持多种语言,我想知道是否可以根据区域设置获得不同语言的地图?

See this link 看到这个链接

It says that 它说

The API detects the browser settings of the user and set the language appropriately. API会检测用户的浏览器设置并正确设置语言。 It is possible to override the language in the APIs; 可以覆盖API中的语言; more information is available in the JavaScript API documentation. JavaScript API文档中提供了更多信息。 Map controls and directions in the Directions Panel have been translated for a subset of languages listed in Supported Languages Spreadsheet. 方向面板中的地图控件和方向已针对支持的语言电子表格中列出的语言子集进行了翻译。 Labels on maps are presented in the preferred language when translations are available. 当翻译可用时,地图上的标签以首选语言显示。

So, Just change the locale on the device . 所以,只需更改设备上的区域设置即可 If translations are available, they will be shown automatically. 如果翻译可用,它们将自动显示。

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

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