VectorPlacemark Geometry (C1.Map)

Posted by: santer.p75 on 26 September 2023, 8:04 am EST

    • Post Options:
    • Link

    Posted 26 September 2023, 8:04 am EST - Updated 26 September 2023, 8:16 am EST

    Hi,

    i try to put Pins on the map control with the GPS coordinate like(45.469588, 9.179472) Milano Italy.

    But when i add a VectorPlacemark the position not in italy. Which coordinate system is used?

    Thanks for helping me

    Dim vpl As New C1.Win.Map.VectorPlacemark()

    _layer.Items.Add(vpl)



    vpl.Geometry = New GeoPoint(45.469588, 9.179472)

  • Posted 27 September 2023, 12:21 am EST

    Hi,

    The GeoPoint constructor accepts (X, Y) coordinates as parameters, which translates to (longitude, latitude). For marking the GPS coordinate of Milano (45.469588, 9.179472), you will need to update your code with

    vpl.Geometry = New GeoPoint(9.179472, 45.469588)

    Please see the attached sample project for reference (MapMarkers.zip)

    Best Regards,

    Kartik

  • Posted 28 September 2023, 5:50 am EST - Updated 28 September 2023, 6:06 am EST

    Thank you it works fine,

    how i can add a label to the marker? I tried this way but it will not show the label…

    Dim mark = New C1.Win.Map.VectorPlacemark()

    _layer.Items.Add(mark)

    'GeoPoint constructor accepts (X, Y) as paramaters, which translates to (longitude, latitude)

    mark.Geometry = New GeoPoint(lon, lat)

    mark.Marker.Size = New SizeF(20, 27.32F)

    mark.Marker.Shape = MarkerShape.Custom

    mark.Marker.CustomShape = New MarkShape()

    mark.Style.Stroke.Color = Color.DarkGray

    mark.Style.Stroke.Width = 1

    mark.Style.BackColor = Color.Red

    mark.Marker.LabelPosition = LabelPosition.Right

    mark.LabelStyle.BackColor = System.Drawing.Color.White

    mark.LabelWidth = 150

    mark.Marker.Caption = “Label next the Marker”

    Is there also a way to set the init position/zoom, so when i start the app i point quick to a position?

    Thank you…

  • Posted 29 September 2023, 1:42 am EST

    Hi,

    1. To show a label alongside the marker, you will need to set the VectorLayer.LabelVisibility property.

    2. To zoom a specific location/marker, you can set the C1Map1.Viewport.Zoom and C1Map1.Viewport.Center properties.

    Please see the updated project for reference (MapMarkers_LabelAndZoom.zip).

    Best Regards,

    Kartik

  • Posted 29 September 2023, 3:15 am EST

    Thank you!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels