title: How change xamarin.forms.maps marker with icon in Android
body: <p>I want to change the current marker on <code>xamarin.forms.maps</code> with icon.</p>
  <p>On my project I create <code>CustomMap.cs</code> class and <code>CustomPin.cs</code> class with this code:</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using Xamarin.Forms.Maps;
  
  namespace MaritsaTundzhaForecast
  {
      public class CustomMap : Map
      {
          public List&lt;CustomPin&gt; CustomPins { get; set; }
      }
  }
  
  using System;
  using Xamarin.Forms.Maps;
  
  namespace MaritsaTundzhaForecast
  {
      public class CustomPin : Pin
      {
          public string Name { get; set; }
          public string Url { get; set; }
      }
  }
  </code></pre>
  <p>After that I set the map on xaml page with this code:</p>
  <pre><code> &lt;Grid&gt;
    &lt;Label Text=&quot;Forecast Maritza-Tundzha&quot;
           HorizontalOptions=&quot;CenterAndExpand&quot;
           FontSize=&quot;Large&quot;
           FontAttributes=&quot;Bold&quot;/&gt;
      &lt;Grid Margin=&quot;0,30,0,10&quot;&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height=&quot;400&quot; /&gt;
          &lt;/Grid.RowDefinitions&gt;
  
        &lt;local:CustomMap x:Name=&quot;customMap&quot;
                 MapType=&quot;Street&quot; /&gt;
      &lt;/Grid&gt;
  &lt;/Grid&gt;
  </code></pre>
  <p>In the same xaml page in the cs file I set marker on the map with this code:</p>
  <pre><code> public MainPage()
      {
          InitializeComponent();
  
          CustomPin pin = new CustomPin
          {
              Type = PinType.Place,
              Position = new Position(37.79752, -122.40183),
              Label = &quot;Xamarin San Francisco Office&quot;,
              Address = &quot;394 Pacific Ave, San Francisco CA&quot;,
              Name = &quot;Xamarin&quot;,
              Url = &quot;http://xamarin.com/about/&quot;
          };
          customMap.CustomPins = new List&lt;CustomPin&gt; { pin };
          customMap.Pins.Add(pin);
          customMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(37.79752, -122.40183), Distance.FromMiles(1.0)));
      }
  </code></pre>
  <p>Now I read this <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/map-pin#customizing-the-marker" rel="nofollow noreferrer">example</a> and I don't know how to use this code from the example in my way:</p>
  <pre><code>    protected override MarkerOptions CreateMarker(Pin pin)
  {
      var marker = new MarkerOptions();
      marker.SetPosition(new LatLng(pin.Position.Latitude, pin.Position.Longitude));
      marker.SetTitle(pin.Label);
      marker.SetSnippet(pin.Address);
      marker.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.pin));
      return marker;
  }
  </code></pre>
  <p>So I set the icon in <code>drawable</code> folder. What can I change from this code to use different icons and whether there is a need to change the code in another class ?</p>
  <p>Аll day I try to replace the standard icon with another icon and fail.</p>