O'Reilly logo

Mastering Xamarin UI Development - Second Edition by Steven F. Daniel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the CustomMapOverlay class using C#

In this section, we will take a look at how to create the CustomMapOverlay class that will inherit from our Xamarin.Forms.Maps namespace and implement the underlying properties and instance methods. These will be used to create a native map overlay using a CustomRenderer class for both our iOS and Android platforms.

Let's start by creating the CustomMapOverlay class by performing the following steps:

  1. First, create a new Empty Class called CustomMapOverlay within the Views folder, as you did in the section entitled Creating and implementing the LocationService class, located within this chapter.
  2. Next, ensure that the CustomMapOverlay.cs file is displayed within the code editor and enter the following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required