Я использую пробную версию Xamarin для установки основного экрана карты на Activity. Я пробовал много примеров avaialble в интернете, но не повезло ..xamarin Карты Google не работают
MyClass:
using Android.App;
using Android.Widget;
using Android.OS;
using Android.Gms.Maps;
namespace GoogleMapTest
{
[Activity (Label = "GoogleMapTest", MainLauncher = true, Icon = "@mipmap/icon")]
public class GoogleMapActivity : Android.Support.V4.App.FragmentActivity
{
protected override void OnCreate(Bundle bundle)
{
var fragTx = SupportFragmentManager.BeginTransaction();
var mapFragment = Android.Gms.Maps.SupportMapFragment.NewInstance();
fragTx.Add(Resource.Id.mapView, mapFragment, "mapView");
fragTx.Commit();
}
}
}
XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:clickable="true"
android:longClickable="true"
android:layout_below="@+id/textLayout"
android:layout_above="@+id/footerLayout" />
</RelativeLayout>
Есть ли вопрос, связанный с пробного аккаунта.
Благодаря
Вы читали документы? Для использования карт Google требуется ключ API. https://developer.xamarin.com/guides/android/platform_features/maps_and_location/maps/part_2_-_maps_api/ – Jason
Да Джейсон .. У меня есть ключ API в моем коде, а также я регистрирую SHA1 и детали пакета с API. – Khurram