无法在Google上显示Google地图

时间:2011-03-23 20:31:56

标签: android google-maps maps

我正在尝试将GoogleMaps显示在模拟器或我的Android设备上..最好是两者。

我已经浏览了互联网上的所有内容,并且没有运气

布局 - Main.xml具有我的debug.keystore的apiKey

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
  android:id="@+id/myLocationText"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:text="@string/hello"
/>
<com.google.android.maps.MapView
  android:id="@+id/myMapView"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:enabled="true"
  android:clickable="true"
  **android:apiKey="0QVYGuX4_0vLI8Uro3uUP3GYvG539JlObdsXxHA"**
/>
</LinearLayout>

清单包括INTERNET和ACCESS_FINE_LOCATION权限

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="jt.com.whereami">
<application 
android:icon="@drawable/icon">
<uses-library android:name="com.google.android.maps"/>
<activity 
android:name=".WhereAmI"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-sdk android:minSdkVersion="7" />
</manifest>

地图显示但只显示框。

我正在使用Eclipse进行开发,其他一切正常。

有什么我想念的吗?

2 个答案:

答案 0 :(得分:0)

正如你所说“地图显示但只显示方框”意味着......经历了类似的类型问题...屏幕上只显示交叉标记......

这是因为缩放级别..我应该将mapview设置为减少大约10个左右...... !!

希望这会有所帮助..

答案 1 :(得分:0)

  

我的debug.keystore的apiKey

用于密钥调试Map API;如果要查看Map,则必须直接从IDE安装(例如:从Eclipse安装)。此PC用于创建MD5并获取MAP API 每台PC都有一个独特的MD5

用于公开的apiKey:它必须从文件.apk安装应用程序以查看地图