Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of how to add pins in maps with click in Xamarin.Forms applications. - http://julianocustodio.com/adicione-pontos-no-maps
using System;
using Xamarin.Forms.Maps;
namespace PinClickDemo
{
public class ExtendedMap : Map
{
public event EventHandler<TapEventArgs> Tap;
public ExtendedMap()
{
}
public ExtendedMap(MapSpan region) : base(region)
{
}
public void OnTap(Position coordinate)
{
OnTap(new TapEventArgs { Position = coordinate });
}
protected virtual void OnTap(TapEventArgs e)
{
var handler = Tap;
if (handler != null) handler(this, e);
}
}
public class TapEventArgs : EventArgs
{
public Position Position { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment