Filip Majernik
Filip Majernik

Reputation: 7810

Map Tiles are not loaded after doing anything with the MapView in Android Google Maps

I have a problem with the MapView. Here's my scenario:

  1. I can successfully create the MapActivity. The initial google maps is loaded. Everything works just fine.

  2. After clicking on the map, trying to move it (or actually do anything), the map tiles are not loaded anymore. And it looks like on the image.

I have already found plenty of threads about not setting the Api Key correctly or whatever. I ensure you, that I have set this correctly (otherwise, the map wouldn't be loaded at all). Does anyone have a solution for this. The Api Level I am using is 8, and I am trying it for android 2.2 in the default emulator. Thanks.

Here is a snippet from the manifest:

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8" />

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

<application ...

Here is the layout file:

    <com.google.android.maps.MapView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/map"
        android:clickable="true"
        android:state_enabled="true"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:apiKey="..." >
    </com.google.android.maps.MapView>

enter image description here

Here is the code from the activity, where I initialize the mapView:

mapView = (MapView) findViewById(R.id.map);
mapView.setStreetView(true);
mapView.setBuiltInZoomControls(true);

It also has a LocationListener, that just animates to the location it receives.

Upvotes: 0

Views: 400

Answers (1)

Nikola Despotoski
Nikola Despotoski

Reputation: 50578

Check the API key and check mapView.setStreetView(); :)

Upvotes: 1

Related Questions