我有簡單的片段類,專門用於顯示谷歌地圖:GoogleMapView沒有加載瓷磚
public class MapFragment extends Fragment implements Map, OnMapReadyCallback {
private static final String TAG = MapFragment.class.getSimpleName();
@Override
public View onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_map, container, false);
MapView googleMapView = (MapView) view.findViewById(R.id.mapFragment_mapView);
googleMapView.onCreate(savedInstanceState);
googleMapView.getMapAsync(this);
return view;
}
@Override
public void onMapReady(GoogleMap googleMap) {
Log.d(TAG, "onMapReady have called");
MapsInitializer.initialize(this.getActivity());
}
}
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<com.google.android.gms.maps.MapView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/mapFragment_mapView" />
</FrameLayout>
當我跑我的應用程序,我可以看到日誌消息,這意味着我已經得到了一個有效的GoogleMap對象。但在屏幕上我看到這張圖片:
對象谷歌地圖是真正的價值 - 例如我可以打開我的位置按鈕,我會在屏幕上看到它。那麼爲什麼地圖瓷磚不加載?
你還沒有谷歌多數民衆贊成簽署你不能讓谷歌地圖或sha1註冊谷歌和簽署sha1也放在谷歌地圖。地圖將加載 – Amitsharma