Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can i display arabic text in google map info-window?

I need to display arabic text on google map info-window, each with their own infowindow.

 Marker marker = googleMap.addMarker(new MarkerOptions().position(new LatLng(latitude, longitude))
         .title(companyName).snippet(companyName));

       CameraPosition cameraPosition = new CameraPosition.Builder().target(
         new LatLng(latitude, longitude)).zoom(12).build();

       googleMap.getUiSettings().setZoomGesturesEnabled(false);
       googleMap.getUiSettings().setCompassEnabled(true);
       googleMap.getUiSettings().setRotateGesturesEnabled(true);
       googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));

       marker.showInfoWindow();
like image 860
MukeshThakur Avatar asked Sep 29 '14 12:09

MukeshThakur


2 Answers

that so simple for rtl language's of course i think that's bug when you write .title("عربی") android show blank infowindow. but you should use this command .title("\u200e"+"عربی")

like image 80
hossein andarkhora Avatar answered Oct 17 '22 14:10

hossein andarkhora


I'm having the same problem. I just discovered that the Google Maps Android SDK 2.0 marker information window is blank if the language on the device is set to Arabic, Hebrew, Persian, or Urdu (i.e. a right to left language) and the passed string is in the same language. I have checked this with Android Studio to make sure that the string is in the correct language. The value of the string is correct when stopped at a breakpoint in AS but not in the information window on the device (the window is blank). It may have something to do with my particular device not fully supporting those languages, or it may be a bug in the SDK (or both).

like image 2
Chris B Avatar answered Oct 17 '22 15:10

Chris B