【问题标题】:Google maps V2 marker's title in other languages谷歌用其他语言映射 V2 标记的标题
【发布时间】:2014-05-16 23:05:18
【问题描述】:

我想在 Google Maps API V2 上显示一个标记:

这是我的代码:

driverMarker = new MarkerOptions();
driverMarker.icon(BitmapDescriptorFactory.fromResource(R.drawable.driver_car));
driverMarker.position(driverLocation);
driverMarker.title(getDriver().getName());
googleMap.addMarker(driverMarker);

司机姓名以希伯来语保存,我的 Google 地图语言也是希伯来语(街道名称)。但是,当我的 getDriver().getName() 返回希伯来语字符串时,它不会显示标题(标题为空白,如您在随附的屏幕截图中所见)。但是如果 poi.getName() 返回英文字符串,它会在标记上显示标题...

如何才能在标记的标题上显示希伯来语???

screenshot

【问题讨论】:

    标签: android google-maps google-maps-markers google-maps-android-api-2


    【解决方案1】:

    您可以通过@Gavriel 在这里找到解决方案:
    Non-ASCII title for android map marker

    简而言之:
    您可以在自定义的 InfoWindowAdapter 中使用 android:textDirection="locale" on TextView(如果您使用的是 api 17 及更高版本)

    在标题/sn-p 前添加一个从左到右的 unicode 标记:

    .title("\u200e" + titleText)
    .snippet("\u200e" + snippetText)
    

    【讨论】:

      猜你喜欢
      • 2015-02-13
      • 1970-01-01
      • 2015-12-04
      • 1970-01-01
      • 1970-01-01
      • 2012-07-09
      • 2015-10-16
      • 1970-01-01
      • 2012-12-07
      相关资源
      最近更新 更多