Skip to content

Setting custom Icons for Markers

Stoyan Bonchev edited this page Sep 22, 2021 · 1 revision
var mapCentre = await PositionMap.GetCenter();
            
var icon = new Icon(new IconOptions()
{
    IconUrl = "leaf-orange.png",
    IconSize = new Point(64, 64)
});
    
var marker = new Marker(mapCentre, new MarkerOptions
{                                
    Keyboard = MarkerViewModel.Keyboard,
    Title = MarkerViewModel.Title,
    Alt = MarkerViewModel.Alt,
    ZIndexOffset = MarkerViewModel.ZIndexOffset,
    Opacity = MarkerViewModel.Opacity,
    RiseOnHover = MarkerViewModel.RiseOnHover,
    RiseOffset = MarkerViewModel.RiseOffset,
});

await marker.AddTo(PositionMap);
await icon.AddTo(marker);

Result

Clone this wiki locally