地图只显示砖 [英] Map only displays tiles
问题描述
我看过很多这样的问题,也尝试了解决方案,但它仍然显示灰瓦,我查了清单,并期待确定。我我的设备上测试它。
这里是我的清单文件。
<清单的xmlns:机器人=http://schemas.android.com/apk/res/android
包=com.dr.droid.lee
安卓版code =1
机器人:=的versionName1.0> <用途-SDK
安卓的minSdkVersion =9
机器人:targetSdkVersion =15/> <使用许可权的android:NAME =android.permission.ACCESS_NETWORK_STATE/>
<使用许可权的android:NAME =android.permission.INTERNET对/>
<使用许可权的android:NAME =android.permission.ACCESS_COARSE_LOCATION/>
<使用许可权的android:NAME =android.permission.ACCESS_FINE_LOCATION/> <应用
机器人:图标=@绘制/ ic_drdroid
机器人:标签=@字符串/ APP_NAME
机器人:主题=@安卓风格/ Theme.Light.NoTitleBar.Fullscreen> <活动
机器人:主NAME =
机器人:标签=@字符串/ title_activity_main
机器人:screenOrientation =肖像>
&所述;意图滤光器>
<作用机器人:名字=android.intent.action.MAIN/> <类机器人:名字=android.intent.category.LAUNCHER/>
&所述; /意图滤光器>
< /活性GT;
<使用库机器人:名字=com.google.android.maps/>
<活动机器人:FirstAidNAME =>
< /活性GT;
<活动机器人:名字=健康>
< /活性GT;
<活动机器人:名字=。DrugGuide>
< /活性GT;
<活动机器人:症状NAME =>
< /活性GT;
<活动机器人:名字=。FResult>
< /活性GT;
<活动机器人:何presultNAME =>
< /活性GT; < /用途>< /清单>
这是我与API密钥的MapView的XML。
< com.google.android.maps.MapView
机器人:ID =@ + ID / MV1
机器人:layout_width =300dp
机器人:layout_height =280dp
机器人:layout_below =@ + ID / tvCity
机器人:layout_centerHorizontal =真
机器人:apiKey =my_api_key
机器人:可点击=真正的>
< /com.google.android.maps.MapView>
最有可能,您使用来构建应用程序不匹配您用来生成谷歌地图API密钥关键中的关键。
仔细检查默认密钥库配置。
如果您使用的是Eclipse ADT +去:
窗口> preferences> Android的>构建>默认调试密钥库
块引用>I've read many problems like this and also tried the solution but it still display grey tiles, I checked the manifest and looks ok. I am testing it on my device. Here is my manifest file.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dr.droid.lee" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="15" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <application android:icon="@drawable/ic_drdroid" android:label="@string/app_name" android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen" > <activity android:name=".Main" android:label="@string/title_activity_main" android:screenOrientation="portrait" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <uses-library android:name = "com.google.android.maps" /> <activity android:name=".FirstAid" > </activity> <activity android:name=".Health" > </activity> <activity android:name=".DrugGuide" > </activity> <activity android:name=".Symptom" > </activity> <activity android:name=".FResult" > </activity> <activity android:name=".HospResult" > </activity> </application> </manifest>
And here is my xml of the mapview with API Key.
<com.google.android.maps.MapView android:id="@+id/mv1" android:layout_width="300dp" android:layout_height="280dp" android:layout_below="@+id/tvCity" android:layout_centerHorizontal="true" android:apiKey="my_api_key" android:clickable="true" > </com.google.android.maps.MapView>
解决方案Most likely, the key that you are using to build the application doesn't match the key you used to generate the google maps api key.
Double check the default keystore configuration.
If you are using Eclipse + ADT go to:
Window > Preferences > Android > Build > Default debug keystore
这篇关于地图只显示砖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!