I use Google Maps Android API v2 with Android to show current position with nearby markers. Nearby places locations and titles are received using Google Places API.
The
Since Arabic and Hebrew are causing problems, and English and Russian are not, I am going to guess that something is broken in the default info window implementation with respect to right-to-left (RTL) languages. Particularly if you are running your tests on Android 4.2, it may be that Maps V2's default info window contents have incorrectly applied the various RTL-related attributes.
Fortunately, you can supply your own info window contents, by implementing InfoWindowAdapter
and having getInfoContents()
return the View
that you want to use in the info window.
For example, this sample project (from tomorrow's update to my book) shows customizing the info window using this InfoWindowAdapter
:
class PopupAdapter implements InfoWindowAdapter {
LayoutInflater inflater=null;
PopupAdapter(LayoutInflater inflater) {
this.inflater=inflater;
}
@Override
public View getInfoWindow(Marker marker) {
return(null);
}
@Override
public View getInfoContents(Marker marker) {
View popup=inflater.inflate(R.layout.popup, null);
TextView tv=(TextView)popup.findViewById(R.id.title);
tv.setText(marker.getTitle());
tv=(TextView)popup.findViewById(R.id.snippet);
tv.setText(marker.getSnippet());
return(popup);
}
}
If you want to replace the whole window, you would have getInfoWindow()
return a View
. If getInfoWindow()
returns null
, getInfoContents()
is used for the contents of the window. You then attach an instance of InfoWindowAdapter
via setInfoWindowAdapter()
on your GoogleMap
.
In your case, you could use your own layout to make sure that you are implementing RTL correctly. That should, in principle, clear up this problem. It is conceivable that Maps V2 does something strange that breaks RTL code that normally should work, in which case you'd need to file an issue.