La carte Google ne montre pas de marqueur. Voici mon extrait de code utilisé pour ajouter marqueurGoogle maps api 2 ne montre pas le marqueur
googleMap = ((MapFragment) getActivity().getFragmentManager().findFragmentById(R.id.map)).getMap();
// check if map is created successfully or not
if (googleMap == null) {
return ;
}
try {
googleMap.addMarker(new MarkerOptions()
.position(new LatLng(0, 0))
.icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_launcher)));
} catch (Exception e) {
Toast.makeText(getActivity(), e.toString(), Toast.LENGTH_LONG).show();
}
Voici ma mise en page xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:orientation="vertical" >
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="300dp"
android:layout_height="300dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
</RelativeLayout>
Semble tout va bien sur la carte et sa performance dans l'écran réel. Notez que j'utilise ce fragment à l'intérieur du fragment (support lib) non étendu à partir de MapFragment. Des idées?