using Android.App;
using Android.Widget;
using Android.OS;
using System;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Gms.Maps;
using Android.Gms.Maps.Model;
using System.Configuration;
namespace googlemaps
{
[Activity(Label = "googlemaps", MainLauncher = true, Icon = "@drawable/icon")]
MainActivity
public class MainActivity: Activity, IOnMapReadyCallback
{
private GoogleMap GMap;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.XMLFile1);
SetUpMap();
}
private void SetUpMap()
{
if (GMap == null)
{
MapFragment mapFragment = (MapFragment)FragmentManager.FindFragmentById(Resource.Id.map).GetMapAsync(this);
}
}
public void OnMapReady(GoogleMap googleMap)
{
MarkerOptions MarkerOptions = new MarkerOptions();
MarkerOptions.SetPosition(new LatLng(16.03, 108));
MarkerOptions.SetTitle("My Postion");
googleMap.AddMarker(MarkerOptions);
googleMap.UiSettings.ZoomControlsEnabled = true;
googleMap.UiSettings.CompassEnabled = true;
googleMap.MoveCamera(CameraUpdateFactory.ZoomIn());
}
}
}
and
'Fragment' does not contain a definition for 'GetMapAsync' and no extension method 'GetMapAsync' accepting a first argument of type 'Fragment' could be found (are you missing a using directive or an assembly reference?) googlemaps
Thank you in advance