I am trying to use this Google.Maps nuget package and example tutorial to implement Google Maps in my Xamarin Forms iOS application. I have installed the nuget package and included the package with using Google.Maps in the iOS section of my project, but when I try to override Google.Maps functions, I am receiving an error that these functions cannot be found:
MyCoolClass.LoadView() : no suitable method found to override
MyCoolClass.ViewWillAppear(bool) : no suitable method found to override
Here is my code:
using System;
using System.Collections.Generic;
using System.Linq;
using CoreGraphics;
using CustomRenderer;
using CustomRenderer.iOS;
using MapKit;
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Maps;
using Xamarin.Forms.Maps.iOS;
using Xamarin.Forms.Platform.iOS;
using Google.Maps;
[assembly: ExportRenderer(typeof(CustomMap), typeof(CustomMapRenderer))]
namespace CustomRenderer.iOS
{
public class CustomMapRenderer : MapRenderer
{
MapView gMapView;
public override void LoadView()
{
base.LoadView();
CameraPosition camera = CameraPosition.FromCamera(latitude: 37.797865,
longitude: -122.402526,
zoom: 6);
mapView = MapView.FromCamera(CGRect.Empty, camera);
mapView.MyLocationEnabled = true;
gMapView = mapView;
}
...
}
Rendererwould not have those methods, the native control (Control) within the renderer would. - SushiHangover