guys! im doing with mapgis to create points(i have coordinate file *csv) and the program work find. But the next, i wana use timer to create point and show it on the map ( each sec draw 1 point) the problem is: just only 1 point appear and i dont know the solution. Here is my code
```
private void button4_Click(object sender, EventArgs e)
{
sf = new MapWinGIS.Shapefile();
axMap1.AddLayer(sf, true);
timer1.Enabled = true;
System.IO.StreamReader myfile = new System.IO.StreamReader(@"D:\19315\road1.csv");
//
listA = new List<String>();
while (!myfile.EndOfStream)
{
var line = myfile.ReadLine();
listA.Add(line);
}
arrayroad = listA.ToArray();
string t = arrayroad[0];
textBox1.AppendText(t);
// string[] coordinate;
double xvalue, yvalue;
//
sf = new MapWinGIS.Shapefile();
bool result = sf.CreateNewWithShapeID("", MapWinGIS.ShpfileType.SHP_POINT);
}
// public string myLine { get; set; }
//int i = 1;
int tick_count = 5;
private double xvalue, yvalue;
public int index = 1;
private void timer1_Tick(object sender, EventArgs e)
{
tick_count++;
if (tick_count < 20)
{
linearray = arrayroad[tick_count];
coordinate = linearray.Split(';');
xvalue = Convert.ToDouble(coordinate[1]);
yvalue = Convert.ToDouble(coordinate[2]);
MapWinGIS.Point pnt = new MapWinGIS.Point();
pnt.x = xvalue;
pnt.y = yvalue;
shp = new MapWinGIS.Shape();
shp.Create(MapWinGIS.ShpfileType.SHP_POINT);
// add point to shape
int index = 0;
if(!shp.InsertPoint(pnt, ref index))
MessageBox.Show("Faile to add point");
// add shape to shape file
sf.EditInsertShape(shp, ref tick_count);
}
axMap1.AddLayer(sf, true);
}
```
```
```
private void button4_Click(object sender, EventArgs e)
{
sf = new MapWinGIS.Shapefile();
axMap1.AddLayer(sf, true);
timer1.Enabled = true;
System.IO.StreamReader myfile = new System.IO.StreamReader(@"D:\19315\road1.csv");
//
listA = new List<String>();
while (!myfile.EndOfStream)
{
var line = myfile.ReadLine();
listA.Add(line);
}
arrayroad = listA.ToArray();
string t = arrayroad[0];
textBox1.AppendText(t);
// string[] coordinate;
double xvalue, yvalue;
//
sf = new MapWinGIS.Shapefile();
bool result = sf.CreateNewWithShapeID("", MapWinGIS.ShpfileType.SHP_POINT);
}
// public string myLine { get; set; }
//int i = 1;
int tick_count = 5;
private double xvalue, yvalue;
public int index = 1;
private void timer1_Tick(object sender, EventArgs e)
{
tick_count++;
if (tick_count < 20)
{
linearray = arrayroad[tick_count];
coordinate = linearray.Split(';');
xvalue = Convert.ToDouble(coordinate[1]);
yvalue = Convert.ToDouble(coordinate[2]);
MapWinGIS.Point pnt = new MapWinGIS.Point();
pnt.x = xvalue;
pnt.y = yvalue;
shp = new MapWinGIS.Shape();
shp.Create(MapWinGIS.ShpfileType.SHP_POINT);
// add point to shape
int index = 0;
if(!shp.InsertPoint(pnt, ref index))
MessageBox.Show("Faile to add point");
// add shape to shape file
sf.EditInsertShape(shp, ref tick_count);
}
axMap1.AddLayer(sf, true);
}
```
```