Custom Markers that use an image

Topics: Windows Forms
Feb 1, 2011 at 4:57 AM


would it be possible to make a custom marker that will take an image thats definable programmatically?

for eg.

dim ImageMarker as New CustomMarker(PointLatLng)

Imagemarker.Image = "someimage.jpg"

Feb 1, 2011 at 7:48 AM

yes, it's posible and easy, just do it ;}

Feb 1, 2011 at 1:37 PM
radioman wrote:

yes, it's posible and easy, just do it ;}

Easy is defined by the person doing it ;)

if you could point  me in the right direction that would help

ps id prefer in VB.NET if possible else ill have to convert




Feb 1, 2011 at 2:46 PM

You could try something like this to get yourself started.  Derive a class from GMap.NET.WindowsForms.GMapMarker and add the following:

Public MarkerImage as System.Drawing.Image

Public Overrides Sub OnRender(ByVal g As System.Drawing.Graphics)
    If Me.MarkerImage IsNot Nothing Then
        g.DrawImage(Me.MarkerImage, Me.LocalPosition)
    End If
End Sub
Feb 1, 2011 at 6:56 PM
Edited Feb 2, 2011 at 11:44 AM

thanks matt

got it working.



Jun 8, 2011 at 5:40 PM


I can change "IsMouseOver" to true?. For placing the cursor over the imageappears ToolTip?

Jun 8, 2011 at 6:21 PM

what? ;/

Jun 9, 2011 at 3:08 PM


The property "IsMouseOver" is read-only, so I could not do that by placing the mouseon the image to show the tool tip.

As I can do this?

In spanish:
La propiedad "IsMouseOver" es de solo lectura, asi que no he podido hacer que al ubicar el mouse sobre la imagen se muestre el tool tip.
Como puedo hacer esto?

Jun 9, 2011 at 3:10 PM

translation is really strange ;}

Jun 10, 2011 at 8:02 AM

I cant really understand your question. If you set your mouse over the marker, the property IsMouseOver changes to true, and the tooltip will be shown, if the property is

Marker.ToolTipMode = MarkerTooltipMode.OnMouseOver

If you want to move your mousecursor to the marker by code, you should try things like:

Windows.Forms.Cursor.Position = New System.Drawing.Point(Marker.LocalPosition)

After that tooltip will be show.

Is this the answer for your question? ;)

Jun 10, 2011 at 3:19 PM

Yes sir,

About my English, excuse me.

You has solved my question.