Draw Lines with coordinates

Oct 22, 2014 at 12:04 PM
I am a really beginner with MapWinGIS activeX.
I like to draw one or several lines give by coordinates on a map.
How can I do that ?

Thanks in advance and greetings
Oct 30, 2014 at 6:18 PM
There are various methods of the Map object, point, lines polygons etc. something like this

TheMap.DrawLineEx(layer, X1, Y1, X2, Y2, Line, Colour)

Which means

themap = referance to your/the mapwin object

layer is a handel to the layer you want to draw on, needs to be a drawing layer

x,y are the co-ors

line is thickness, long i think
colour is colour as a long

See here:
Marked as answer by pmeems on 11/23/2014 at 4:50 AM
Nov 23, 2014 at 12:50 PM
Hi @BraveNewWorld,

Do you still have problems?
More documentation can be found at http://www.mapwindow.org/documentation/mapwingis4.9/index.html
This is a good starting point: http://www.mapwindow.org/documentation/mapwingis4.9/getting_started.html


Oct 20, 2015 at 12:35 PM
Hello @ Paul,

How do I draw a set of graphic lines with equal spacing e.g. dx for every line drawn?

I have this code for drawing the line but I don't know how to make it graphic and also add the spacing

void DrawLine( double x1, double y1, double x2, double y2, int pixelWidth, Color color)
//Set point 1 as x = 100, y = 100
x1 = 50
y1 = 50
'Set point2 as x = 500, y = 500
x2 = 100
y2 = 100
//Set pixel width for the line as 1
width = 1
//Set the color for the line as green
col = RGB(0, 255, 0)
//Create new drawing layer on map
draw_hndl = Map1.NewDrawing(MapWinGIS.tkDrawReferenceList.dlScreenReferencedList)
'Draw green line from point 1 to point 2
Map1.DrawLine x1, y1, x2, y2, width, col