ComponentOne Maps for WinForms
Working with Map Control / Adding Markers / Adding Custom Marker
In This Topic
    Adding Custom Marker
    In This Topic

    You can easily add a custom marker on a map surface using Map control. For doing so, you need to create a class that implements C1.Win.Map.CustomShape class for creating a custom shape. The following code can be used to add a custom marker on a map:

    Dim vl = New C1.Win.Map.VectorLayer()
    C1Map1.Layers.Add(vl)
    
    Dim placemark = New C1.Win.Map.VectorPlacemark()
    placemark.Geometry = New GeoPoint(110, 65)
    vl.Items.Add(placemark)
    
    ' needs set Shape to MarkerShape first
    placemark.Marker.Shape = MarkerShape.[Custom]
    placemark.Marker.Size = New SizeF(20, 27.32F)
    
    ' then set the CustomShape.
    Dim shape = New SampleCustomShape(0)
    placemark.Marker.CustomShape = shape
    
    var vl = new C1.Win.Map.VectorLayer();
    c1Map1.Layers.Add(vl);
    
    var placemark = new C1.Win.Map.VectorPlacemark();
    placemark.Geometry = new GeoPoint(110, 65);
    vl.Items.Add(placemark);
    
    // needs set Shape to MarkerShape first
    placemark.Marker.Shape = MarkerShape.Custom;
    placemark.Marker.Size = new SizeF(20, 27.32f);
    
    // then set the CustomShape.
    var shape = new SampleCustomShape(0);
    placemark.Marker.CustomShape = shape;
    

    The map with a custom marker will look similar to the image given below.
    Map with a custom marker