1

我尝试了下面的教程 MapView。

我已经添加了

1) 单声道,Android.Googlemaps。

2)使用Android.Locations;

3)实现:公共类Activity1:MapActivity

这些是错误消息:

错误 CS0115:“MapView.Activity1.IsRouteDisplayed”:找不到合适的方法来覆盖 (CS0115) (MapView)

错误 CS0246:找不到类型或命名空间名称“MapActivity”(您是否缺少 using 指令或程序集引用?) (CS0246) (MapView)

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">

    <com.google.android.maps.MapView
        android:id="@+id/map"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:apiKey="my google map key here" />
</LinearLayout>

[Activity (Label = "MapView", MainLauncher = true)]

public class Activity1 : MapActivity
{
    protected override void OnCreate (Bundle bundle)
    {
        base.OnCreate (bundle);

    SetContentView (Resource.Layout.Main);  
    }

    protected override bool IsRouteDisplayed 
    {
        get 
    {
            return false;              
    }
    }
}

非常感谢您对此的帮助。

谢谢

4

1 回答 1

1

正如评论者已经提到的,谷歌地图 v1 不再适用于新应用程序。

相反,您必须使用来自 Google Play 服务的 v2。

使用 v2 并不完全简单——谷歌许可使得重新分发谷歌播放组件变得很困难,但是有一个教程可以工作。

于 2013-05-18T11:08:23.947 回答