GmapMarkerCircle On render sub do not fire.

Topics: Help
Dec 9, 2012 at 9:01 AM
Edited Dec 9, 2012 at 11:18 AM

How does the Public Overrides Sub OnRender works ?  I have several classes to draw images, custommarkers and circles ontop of the map. Each class have their own Public Overrides Sub OnRender(ByVal g As Graphics).. seems like only one of the subs is firing ? .. --> Ex. adding a circle on the Gmap doubleclick event and the markerimage Onrender sub is firing instead of markercircle..

If I am supposed to only have one Onrender subrutine in my mapproject how to distinguish between marker and circles.. If I have all my code in one OnRender sub I get circles and marker on all places.

 


This sub is firing for adding markerimage 
 Public Overrides Sub OnRender(ByVal g As Graphics)
        g.DrawImage(img, LocalPosition.X, LocalPosition.Y, Size.Width, Size.Height)

    End Sub

Instead of 
Public Overrides Sub OnRender(ByVal g As Graphics)


        g.SmoothingMode = SmoothingMode.AntiAlias
        Dim groundResolution As Double = form1.GMap1.MapProvider.Projection.GetGroundResolution(Convert.ToInt32(form1.GMap1.Zoom), Position.Lat)
        Dim diameter As Integer = CInt(m_Radius * 2 * 1000 / groundResolution)

        Size = New System.Drawing.Size(diameter, diameter)
        Offset = New System.Drawing.Point(-Size.Width / 2, -Size.Height / 2)

        g.DrawEllipse(Pens.Black, New Rectangle(LocalPosition.X, LocalPosition.Y, diameter, diameter))
        g.FillEllipse(Brushes.Cyan, New Rectangle(LocalPosition.X, LocalPosition.Y, diameter, diameter))


    End Sub