ioustinos
Posts: 5
Joined: Thu Jul 15, 2010 12:55 am
Contact: Website

Draw radius around a point

Sat Jul 24, 2010 7:56 pm

I want to draw a 20km radius circle around a point and a want it to adjust as a zomm in and out.

Here is what i did

Code: Select all

Public Function getPositionAtDistance(ByVal objPos As GpsToolsNET.Position, ByVal dist As Double, ByVal deg As Integer) As GpsToolsNET.Position
        Dim tempObj As GpsToolsNET.Position = objPos
        tempObj.Move(dist * 1000, deg, GpsToolsNET.DistanceMethod.GREAT_CIRCLE_DISTANCE)
        Return tempObj
End Function

Code: Select all

 Public Function drawCircle(ByVal objPos As GpsToolsNET.Position, ByVal radius As Double, ByVal col As Color) As GpsShapeNET.Shape
        ' Create a new shape object.
        Dim objShape As New GpsShapeNET.Shape
        Dim nodeDatumGrid As New GpsToolsNET.Position
        nodeDatumGrid.Datum = 1
        objShape.DatumGridTemplate = nodeDatumGrid

        ' Create a mapshape obejct to handle drawing mechanism for this shape.
        Dim objMapShape As GpsViewNET.MapShape = Map1.NewMapShape(objShape)

        objMapShape.Border.Width = 1
        objMapShape.Background.Transparent = True ' Unset background object.
        objMapShape.NodeTemplate = Nothing

        Dim i As Integer
        For i = 0 To 360
            objShape.NewNode(-1)
            objShape.Position = getPositionAtDistance(objPos, radius, i)
        Next
        Return objShape
    End Function

but what i get is an elliptical circle.
Why?
I did not use an ellipse as it would not adjust to zoom levels


ioustinos
Posts: 5
Joined: Thu Jul 15, 2010 12:55 am
Contact: Website

RE: Draw radius around a point

Tue Aug 03, 2010 9:34 pm

Hallo?
Is franson team there please?

Return to “GpsTools”