0
votes

I'm currently using Maps in Xamarin Forms. It works fine for this example. https://developer.xamarin.com/guides/xamarin-forms/user-interface/map/

Now i need to change just the colour of the Pin, the following example is not really what i'm looking for as its a bit of an overkill for me.

https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/custom-renderer/map/customized-pin/

Is there an easier way to just change the color? I've tried:

var pin = new Pin                   {
Type = (data.contractDate>= DateTime.Now) ? PinType.SavedPin : PinType.Place

But this doesn't change the color.

2

2 Answers

1
votes

The Xamarin Map control doesn't have that much customization support. It will just implement the basic cross-platform maps. If on the platform you're running on the color of a 'saved pin' and a 'place pin' is different then it will show a difference, but on another platform it will not. If you just need the pin customization, you can have a look at this

If you want to do this and maybe more, have a look at TK Custom Map for instance.

0
votes

you can using

marker.SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueRed));

Tutorial below (not written by me)

https://montemagno.com/colored-map-markers-ios-and-android/