Now, we will create a custom renderer for Android. The structure is the same as the one we used for iOS. We will use the ExportRenderer attribute in the same way and we will also add the MapRenderer class as the base class. This, however, is the Android-specific MapRenderer.
We will start by creating a custom renderer for our CustomMap control. The renderer will inherit from the MapRenderer base class so that we can extend any existing functionality. To do this, follow these steps:
- Create a folder called Renderers in the MeTracker.Android project.
- Create a new class in this folder called CustomMapRenderer.
- Add MapRenderer as a base class.
- Add the ExportRenderer attribute.
- Add a constructor that has Context as a parameter. Pass this parameter to the constructor of the base class.
- Resolve all the references, as shown in the following code:
using System.ComponentModel;
using Android...