蓝点/箭头未显示在我的地图上。其他一切正常。我错过了一些权限吗?
包括 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"/>