Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How can we add multiple image to the map according to the status on the pin list

$
0
0

I have a custom map implementation in xamrin.froms . am able to customize the pin icon to custom icons (image). i have different pins and those pin have different icons . am not able to bind the different icons to the map. Its always same icons even i have added the conditions .

'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);  

        customPins.ToList().ForEach(x =>{

            switch ((x.PinType){
                case PinTypeOptions.Vehicle:
                    marker.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.Truck50));
                    break;
                case PinTypeOptions.OperationLocation:
                    marker.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.feuerwehrauto100));

                    break;
                default:
                    break;
            }                
        });                
        return marker;
    }'

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>