我正在尝试加载 GoogleMap。我使用该<uses-library android:name="com.google.android.maps" />
库,这是 MapView 的 xml。
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="AIzaSyDvTjB5XuzifATB4G50qBc7TTRo5luhV9o"
/>
我的活动扩展了MapActivity as public class Geofencesetup extends MapActivity {}
。但是当我运行代码时,我只有很小的网格,看不到地图。我的应用程序有两个 xml,一个具有另一个地图显示应用程序的片段,如下所示
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment" />
我想添加 MapView,因为它更适合为地理围栏设置制作叠加层。对于片段,我可以看到整个地图,但对于 MapView,我只看到网格。我的查询是(1)我可以在同一个应用程序中使用com.google.android.gms.maps.SupportMapFragment
和吗?com.google.android.maps.MapView
(2)为什么我在 MapView 上只看到网格?谢谢