我遇到了使GoogleMaps API在我的应用中运行的麻烦。当我在模拟器或Galaxy S4上打开我的应用程序时,地图显示为空白,只显示灰色网格。当我在模拟器中运行应用程序时,我在eclipse控制台中收到错误: “服务器返回:3”
感谢
// activity_map.xml
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapView"
android:layout_gravity="bottom"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="APIKEY"
android:clickable="true"
/>
// GoogleActivtiy.java
package com.example.thetest;
import android.os.Bundle;
import com.google.android.maps.MapActivity;
public class GoogleMapActivity extends MapActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
}
@Override
protected boolean isRouteDisplayed() {
return true;
}
}
// logcat的
04-22 18:33:48.410: W/System.err(872): java.io.IOException: Server returned: 3
04-22 18:33:48.420: W/System.err(872): at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
04-22 18:33:48.420: W/System.err(872): at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
04-22 18:33:48.420: W/System.err(872): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
04-22 18:33:48.420: W/System.err(872): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
04-22 18:33:48.420: W/System.err(872): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
04-22 18:33:48.420: W/System.err(872): at java.lang.Thread.run(Thread.java:841)
04-22 18:33:48.830: W/System.err(872): IOException processing: 26
答案 0 :(得分:0)
答案 1 :(得分:0)
你正在使用谷歌地图的旧方式。目前这种方式并没有使用谷歌已经宣布谷歌地图的这种方法还没有进一步支持。所以请使用Google Map V2。你有以下链接的教程,这对初学者来说也很好