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);
}
```
```
Comments: You should ask questions in the Discussion section not report an issue. I quickly looked at your code and I see you create a shapefile several time and add several versions as layer as well. It is best to create a shapefile once and add it to the map when you are done with it. If you want to update a shapefile which is already added to the layer you need to grab that shapefile using http://www.mapwindow.org/documentation/mapwingis4.9/group__map__layer__management.html#gad42f479b7aca0c8424639a9b619b6cc2 and not create a new one.
```
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);
}
```
```
Comments: You should ask questions in the Discussion section not report an issue. I quickly looked at your code and I see you create a shapefile several time and add several versions as layer as well. It is best to create a shapefile once and add it to the map when you are done with it. If you want to update a shapefile which is already added to the layer you need to grab that shapefile using http://www.mapwindow.org/documentation/mapwingis4.9/group__map__layer__management.html#gad42f479b7aca0c8424639a9b619b6cc2 and not create a new one.