我得到了地图在标签中查看,直到今天它工作得很好。请记住,我已经触摸了地图视图中的任何代码,因为我知道它的工作原理。突然之间,地图视图上的任何内容都不再是视图,只是地图网格。这会导致什么?我尝试了一个新的API密钥,它似乎不工作。谷歌地图加载一切正常。我甚至在其他手机上尝试过,仍然只是一个网格。地图显示一个网格,没有显示地图
地图类
package com.nyneaxis.api.gascloud;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import android.os.Bundle;
import android.widget.LinearLayout;
public class StationsMap extends MapActivity {
LinearLayout linearLayout;
MapView mapView;
public void onCreate(Bundle savedInstanceState){
mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
maps.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainlayout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="ABQIAAAAYc7mzgA4G-2FaBLUHTM_1xTjBItGPNb7O-Zq4IGUb6RxSdEi4RQ7Y-p4UARzkmuBTxknyrJRWOA31w"
/>
</RelativeLayout>
我认为你的API密钥是错误的。 – Sunny
我只是比较api密钥长度和你的api密钥太长。我的API密钥是0bBgLl42nWwnTf983Y5VdIgfZI6mC7meL7Ms_qg。我只是猜测, – Sunny
尝试不同的/新的API,仍然没有。只是一个普通的网格!这是Google为我生成的API。 –