Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
How to add Symbol on XamMap
posted

Hello, I'm trying to add a simple simple in a geographical location (lat, lon) using the following code, but nothing appears. Note that the shape file renders correctly on the control. What am I doing wrong?):

<ig:XamMap Grid.Column="2" x:Name="MapMain">

                <ig:XamMap.Layers>

                    <ig:MapLayer x:Name="BasicLayer">

                        <ig:MapLayer.Reader>

                            <ig:ShapeFileReader x:Name="BasicShapeReader" Uri="Maps\ShapeFiles\sample"/>

                        </ig:MapLayer.Reader>

                    </ig:MapLayer>

                </ig:XamMap.Layers>

            </ig:XamMap>

 

 

 Private Sub ShowSymbol()

        Dim symbolPoint As Point = MapMain1.MapProjection.ProjectToMap(New Point(23.15, 42.27))

 

        Dim element As New SymbolElement()

        element.SymbolOrigin = symbolPoint

        element.Caption = "myCaption"

        element.SymbolType = MapSymbolType.Bubble

        element.SymbolSize = 20

 

        MapMain.Layers(0).Elements.Add(element)

    End Sub

Parents
  • 2505
    Offline posted

    Hi,

    The coordinates of the symbolPoint are set according to the internal coordinate system of the MapMain1 control, so it is possible that because of differences between the coordinate systems of MapMain1 and MapMain, the point can't be visualized. Do you think this could be the case?

    Best regards,
    Milana Zhileva

Reply Children