Cool polygons

Topics: Feature Requests
Oct 12, 2010 at 9:17 AM

Would it be possible to create polygons in the same manner as this demo:



Oct 12, 2010 at 9:21 AM

Thats exactly the logic i was going to use in the polygons,  split each line into 2 and allow the draging of the centre points.  I notice that moving markers/polygons was shown in the latest demo.

Would be nice to have this split line feature too.   Just need to find time ........

Oct 12, 2010 at 10:13 AM

yes, you can do it, but now there is no built-in feature to do so, you manually need update polygon, catch the drag start/end/etc...

Oct 12, 2010 at 10:40 AM

If anyone has the skill set to accomplish this I would love to see it as an added feature.

Oct 12, 2010 at 7:41 PM

It's not hard to do, I implemented something like it for a recent project.

If I get a moment I will cut out the code and post it here.

Oct 12, 2010 at 10:00 PM

Nice one Azlan, look forward to it.


Oct 14, 2010 at 9:40 AM


zeqk    did some work on this.

in that post, radioman says that its now implemented in the demo,  i'm not sure that the functionality of being able to drag a 'middle' marker and cause a line split is done in the

current Gmap release, but if   zeqk   has already done that , them maybe someone could just include it as standard ?

radioman, please confirm if this is included in the latest release




Oct 14, 2010 at 10:59 AM

it is included in demo, but not as polygon functionality

Oct 14, 2010 at 3:48 PM

yes, but the polygon included in the demo is not able to add more vertices. Only can resize the polygon.

I'm doing a clearer example of how to do this


Oct 14, 2010 at 4:05 PM
Edited Oct 14, 2010 at 4:07 PM
Thanks Zeqk
Oct 14, 2010 at 7:16 PM

Uploaded with


I uploaded a example

Oct 14, 2010 at 8:22 PM

nice! ..i wonder how to put it together in one piece

Oct 14, 2010 at 10:35 PM

Hi Zeqk, it looks very good apart from one thing, as soon as I had your assembly into my VB project my project will not build and gives me no errors, it just says ‘build failed’ with no errors.


Do you have any idea why this would happen?

Oct 15, 2010 at 1:32 PM

you have to have GMap.NET dlls

maybe that's the problem

Oct 15, 2010 at 1:42 PM

I used all the dlls in your download.



Oct 20, 2010 at 12:06 PM

Hi all =)

It's good work, zeqk

radioman, when we will see this feature in main branch of gMap ? =)

Now I try to implement drawing polygone on gMap and this feature is very useful for me,

should I wait a new branch with this feature or implement this in my project ?

Oct 20, 2010 at 1:40 PM

i'm in reconstruction now, can't focus on polygons now, to much changes...

Feb 21, 2011 at 10:09 AM

seqk, I have a (noob) question.

I am using vs2010, and am trying to get your example solution converted and working. I get this following error:

Marked: Application.Run(new Form1());

Could not load file or assembly 'GMap.NET.Core, Version=, Culture=neutral, PublicKeyToken=b85b9027b614afef' or one of its dependencies.
An attempt was made to load a program with an incorrect format.

Tried replacing the dlls with the original projects, and using different versions.



Feb 21, 2011 at 12:38 PM

I never tried using the vs2010

but you can try clean the solution, go to the bin folder an delete all.

Remove the GMap.NET references and add again.

Compile for 32 bits

Jul 30, 2011 at 11:21 PM

radioman did you get any free time for implement that? :)

Jul 31, 2011 at 9:29 AM

to bad i have no free time ;}

Aug 2, 2011 at 9:56 AM


A polygon plotting tool is really easy to do.  I built a framework for adding "Tools" to GMaps.  Here's an overview:

- An interface - IGMapTool - mas methods for MouseClick, MouseDown, MouseMove, MouseUp.

- A GMapControl descendant which has a CurrentTool property of type IGMapTool

- The descendant traps MouseClick, MouseDown, MouseMove, MouseUp, etc. and call the corresponding methods in CurrentTool if it isn't null.

Now, create a PlotPolygonTool class which implements IGMapTool. On the first mouse click it creates a new GMapPolygon object and adds it to the map.  On each MouseClick, add the mouse point to the polygon and redraw.  On MouseDoubleClick, complete the polygon and reset.  Dragging points can be done easily too, but I haven't done the dragging of the mid-point of lines, just dragging polygon points.

If I can extract this from our systems I'll post some code, or perhaps do a fork if there's enough interest.

Aug 4, 2011 at 1:31 AM

I'm interessed :)

Aug 4, 2011 at 2:34 PM

I've created a fork, GMapNETKnightlie, I'll add the Tools code to it.  It's forked from the current unstable release so it's a bit.... unstable ;-), but the tool code works.  I'll post when I've pushed the updates, probably tomorrow.

Aug 5, 2011 at 11:57 AM

Code uploaded.  See