What is the proper object to inherit from when trying to add a Tap handler on a map on android? I've tried with MapView, MapRenderer, MapActivity, Overlay to name a few.
CustomMapRenderer.cs
Totally wrong, but showing what I've been trying.
using Xamarin.Forms;
using nuMaps;
using nuMaps.Droid;
using Android.Gms.Maps;
using System;
using Xamarin.Forms.Maps.Android;
using Xamarin.Forms.Platform.Android;
using Android.App;
using Xamarin.Forms.Maps;
using Android.Widget;
using Android.GoogleMaps;
namespace nuMaps.Droid
{
public class CustomMapRenderer MapActivity
{
public override bool OnTouchEvent (Android.Views.MotionEvent e, Android.GoogleMaps.MapView mapView)
{
Console.WriteLine (e.Action);
return base.OnTouchEvent (e, mapView);
}
}
}
MapPage.xaml
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:nuMaps;assembly=nuMaps"
x:Class="nuMaps.MapPage">
<ContentPage.Content>
<AbsoluteLayout>
<local:CustomMap
x:Name="MyMap"
IsShowingUser="true"
MapType="Hybrid"
AbsoluteLayout.LayoutBounds="0, 0, 1, 1"
AbsoluteLayout.LayoutFlags="All"
/>
</AbsoluteLayout>
</ContentPage.Content>
</ContentPage>