Distance scale

Topics: Feature Requests
Jan 30, 2012 at 1:48 PM

Any chance for a distance scale overlay? This is something that pretty much every web-based slippy map has, and I think it wouyld be a very useful addition.

Jan 30, 2012 at 1:59 PM

windows forms has property MapScaleInfoEnabled, currently wpf version doesn't have scale indicator

Jan 30, 2012 at 3:24 PM

put in your GMapControl

 

    Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
        'rendering stuff
        MyBase.OnPaint(e)


        '      Scale
        Dim ScaleAs String = String.Empty

        Try
            Dim StartPixel As PointLatLng = Form_Main.MainMap.FromLocalToLatLng(0, 100)
            Dim StopPixel As PointLatLng = Form_Main.MainMap.FromLocalToLatLng(100, 100)
            Dim Distance As Double = (Form_Main.MainMap.MapProvider.Projection.GetDistance(StartPixel, StopPixel) * 1000)

            Dim int_Distance As Integer = Convert.ToInt32(Distance)

            If ((int_Distance < 1000)) Then
                Scale= (int_Distance.ToString + " m")

            Else
                Distance= Distance/ 1000
                Scale= Distance.ToString("N2") + " km"
            End If

            e.Graphics.DrawRectangle(Pens.AntiqueWhite, (500 + i), (Height - 10), 25, 4)
            e.Graphics.DrawRectangle(Pens.Black, (526 + i), (Height - 10), 24, 4)
            e.Graphics.DrawRectangle(Pens.AntiqueWhite, (551 + i), (Height - 10), 24, 4)
            e.Graphics.DrawRectangle(Pens.Black, (576 + i), (Height - 10), 25, 4)
            e.Graphics.DrawString(Scale, Font, Brushes.BlanchedAlmond, (605 + i), (Height - 14))

        Catch ex As Exception

        End Try


    End Sub

 

looks a little bit more like a scale.. ^^

regards EDE