【发布时间】:2012-11-25 19:18:55
【问题描述】:
我的地图上没有显示蓝点/箭头。其他一切正常。我是否缺少一些权限?
包括 Java 类、清单和布局 XML。
private void setUpMap(int satelliteMode, LatLng startPoint, float zoomLevel) {
mapView.getUiSettings().setZoomControlsEnabled(false);
//mapView.getUiSettings().setMyLocationButtonEnabled(false);
mapView.setMapType(satelliteMode);
mapView.setMyLocationEnabled(true);
mapView.moveCamera(CameraUpdateFactory.newLatLngZoom(startPoint, zoomLevel));
}
xml:
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapview"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment"/>
清单:
<permission
android:name="com.example.project.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.project.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="API_KEY"/>
【问题讨论】:
-
它可以与此设备上的 Google 地图应用程序一起使用吗?在较新版本的 Android 中存在一个问题,您必须特别通过“设置”应用的“帐户”区域授予 Google 地图的权限,以便它能够使用 GPS。可以想象,这也会影响 V2 Maps 的东西。
-
遗憾的是,蓝点在我的三星 Galaxy s2 上的谷歌地图应用程序中显示良好
-
我的应用的设备内设置甚至说这个应用可以访问“你的位置”(也有“网络通信”)
-
我只想指出,我目前遇到了同样的问题,代码几乎相同:/
-
所以没有人可以解决这个问题?希望安卓能尽快解决这个问题。
标签: java android eclipse google-maps geolocation